Add routing regression test for session.mainKey precedence

This commit is contained in:
Vincent Koc
2026-03-02 00:04:19 -08:00
parent e6cf0bce5e
commit 61daccbd0f

View File

@@ -31,6 +31,19 @@ describe("resolveMainSessionAlias", () => {
scope: "per-sender",
});
});
it("uses session.mainKey over any legacy routing sessions key", () => {
const cfg = {
session: { mainKey: " work ", scope: "per-sender" },
routing: { sessions: { mainKey: "legacy-main" } },
} as OpenClawConfig;
expect(resolveMainSessionAlias(cfg)).toEqual({
mainKey: "work",
alias: "work",
scope: "per-sender",
});
});
});
describe("session key display/internal mapping", () => {