mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:20:43 +00:00
fix: require cli auth epoch version (#70132)
This commit is contained in:
@@ -47,9 +47,12 @@ describe("cli-session helpers", () => {
|
||||
claudeCliSessionId: "legacy-session",
|
||||
};
|
||||
|
||||
expect(resolveCliSessionReuse({ binding: getCliSessionBinding(entry, "claude-cli") })).toEqual({
|
||||
sessionId: "legacy-session",
|
||||
});
|
||||
expect(
|
||||
resolveCliSessionReuse({
|
||||
binding: getCliSessionBinding(entry, "claude-cli"),
|
||||
authEpochVersion: 2,
|
||||
}),
|
||||
).toEqual({ sessionId: "legacy-session" });
|
||||
});
|
||||
|
||||
it("invalidates legacy bindings when auth, prompt, or MCP state changes", () => {
|
||||
@@ -64,18 +67,21 @@ describe("cli-session helpers", () => {
|
||||
expect(
|
||||
resolveCliSessionReuse({
|
||||
binding,
|
||||
authEpochVersion: 2,
|
||||
authProfileId: "anthropic:work",
|
||||
}),
|
||||
).toEqual({ invalidatedReason: "auth-profile" });
|
||||
expect(
|
||||
resolveCliSessionReuse({
|
||||
binding,
|
||||
authEpochVersion: 2,
|
||||
extraSystemPromptHash: "prompt-hash",
|
||||
}),
|
||||
).toEqual({ invalidatedReason: "system-prompt" });
|
||||
expect(
|
||||
resolveCliSessionReuse({
|
||||
binding,
|
||||
authEpochVersion: 2,
|
||||
mcpConfigHash: "mcp-hash",
|
||||
}),
|
||||
).toEqual({ invalidatedReason: "mcp" });
|
||||
|
||||
@@ -126,7 +126,7 @@ export function resolveCliSessionReuse(params: {
|
||||
binding?: CliSessionBinding;
|
||||
authProfileId?: string;
|
||||
authEpoch?: string;
|
||||
authEpochVersion?: number;
|
||||
authEpochVersion: number;
|
||||
extraSystemPromptHash?: string;
|
||||
mcpConfigHash?: string;
|
||||
mcpResumeHash?: string;
|
||||
|
||||
Reference in New Issue
Block a user