refactor: normalize main session key handling
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
resolveStorePath,
|
||||
} from "../config/sessions.js";
|
||||
import { callGateway, randomIdempotencyKey } from "../gateway/call.js";
|
||||
import { normalizeMainKey } from "../routing/session-key.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { normalizeMessageProvider } from "../utils/message-provider.js";
|
||||
import { agentCommand } from "./agent.js";
|
||||
@@ -51,7 +52,7 @@ function resolveGatewaySessionKey(opts: {
|
||||
}): string | undefined {
|
||||
const sessionCfg = opts.cfg.session;
|
||||
const scope = sessionCfg?.scope ?? "per-sender";
|
||||
const mainKey = sessionCfg?.mainKey ?? "main";
|
||||
const mainKey = normalizeMainKey(sessionCfg?.mainKey);
|
||||
const storePath = resolveStorePath(sessionCfg?.store);
|
||||
const store = loadSessionStore(storePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user