






















@@ -178,6 +178,37 @@ describe("cli-session helpers", () => {
178178).toEqual({ invalidatedReason: "mcp" });
179179});
180180181+it("falls back to legacy MCP config hashes when stored resume hashes are absent", () => {
182+const binding = {
183+sessionId: "cli-session-1",
184+authProfileId: "anthropic:work",
185+authEpoch: "auth-epoch-a",
186+extraSystemPromptHash: "prompt-a",
187+mcpConfigHash: "mcp-config-a",
188+};
189+190+expect(
191+resolveCliSessionReuse({
192+ binding,
193+authProfileId: "anthropic:work",
194+authEpoch: "auth-epoch-a",
195+extraSystemPromptHash: "prompt-a",
196+mcpConfigHash: "mcp-config-a",
197+mcpResumeHash: "mcp-resume-a",
198+}),
199+).toEqual({ sessionId: "cli-session-1" });
200+expect(
201+resolveCliSessionReuse({
202+ binding,
203+authProfileId: "anthropic:work",
204+authEpoch: "auth-epoch-a",
205+extraSystemPromptHash: "prompt-a",
206+mcpConfigHash: "mcp-config-b",
207+mcpResumeHash: "mcp-resume-a",
208+}),
209+).toEqual({ invalidatedReason: "mcp" });
210+});
211+181212it("clears provider-scoped and global CLI session state", () => {
182213const entry: SessionEntry = {
183214sessionId: "openclaw-session",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。