refactor: normalize main session key handling
This commit is contained in:
1 parent
83270f98f7
commit
6c7a27c010
14 files changed
+40
-30
No files matched your search
@@ -21,8 +21,8 @@ import {
|
||||
type SessionScope,
|
||||
} from "../config/sessions.js";
|
||||
import {
|
||||
DEFAULT_MAIN_KEY,
|
||||
normalizeAgentId,
|
||||
normalizeMainKey,
|
||||
parseAgentSessionKey,
|
||||
} from "../routing/session-key.js";
|
||||
|
||||
@@ -255,8 +255,7 @@ export function listAgentsForGateway(cfg: ClawdbotConfig): {
|
||||
agents: GatewayAgentRow[];
|
||||
} {
|
||||
const defaultId = normalizeAgentId(resolveDefaultAgentId(cfg));
|
||||
const mainKey =
|
||||
(cfg.session?.mainKey ?? DEFAULT_MAIN_KEY).trim() || DEFAULT_MAIN_KEY;
|
||||
const mainKey = normalizeMainKey(cfg.session?.mainKey);
|
||||
const scope = cfg.session?.scope ?? "per-sender";
|
||||
const configuredById = new Map<string, { name?: string }>();
|
||||
for (const entry of cfg.agents?.list ?? []) {
|
||||
|
||||
Reference in new issue
Block a user