[AI-assisted] test: fix typing and test fixture issues (#31444)

* test: fix typing and test fixture issues

* Fix type-test harness issues from session routing and mock typing

* Add routing regression test for session.mainKey precedence
This commit is contained in:
Vincent Koc
2026-03-02 00:41:21 -08:00
committed by GitHub
parent 1443bb9a84
commit 29c3ce9454
13 changed files with 195 additions and 104 deletions

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", () => {