mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11: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",
|
claudeCliSessionId: "legacy-session",
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(resolveCliSessionReuse({ binding: getCliSessionBinding(entry, "claude-cli") })).toEqual({
|
expect(
|
||||||
sessionId: "legacy-session",
|
resolveCliSessionReuse({
|
||||||
});
|
binding: getCliSessionBinding(entry, "claude-cli"),
|
||||||
|
authEpochVersion: 2,
|
||||||
|
}),
|
||||||
|
).toEqual({ sessionId: "legacy-session" });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("invalidates legacy bindings when auth, prompt, or MCP state changes", () => {
|
it("invalidates legacy bindings when auth, prompt, or MCP state changes", () => {
|
||||||
@@ -64,18 +67,21 @@ describe("cli-session helpers", () => {
|
|||||||
expect(
|
expect(
|
||||||
resolveCliSessionReuse({
|
resolveCliSessionReuse({
|
||||||
binding,
|
binding,
|
||||||
|
authEpochVersion: 2,
|
||||||
authProfileId: "anthropic:work",
|
authProfileId: "anthropic:work",
|
||||||
}),
|
}),
|
||||||
).toEqual({ invalidatedReason: "auth-profile" });
|
).toEqual({ invalidatedReason: "auth-profile" });
|
||||||
expect(
|
expect(
|
||||||
resolveCliSessionReuse({
|
resolveCliSessionReuse({
|
||||||
binding,
|
binding,
|
||||||
|
authEpochVersion: 2,
|
||||||
extraSystemPromptHash: "prompt-hash",
|
extraSystemPromptHash: "prompt-hash",
|
||||||
}),
|
}),
|
||||||
).toEqual({ invalidatedReason: "system-prompt" });
|
).toEqual({ invalidatedReason: "system-prompt" });
|
||||||
expect(
|
expect(
|
||||||
resolveCliSessionReuse({
|
resolveCliSessionReuse({
|
||||||
binding,
|
binding,
|
||||||
|
authEpochVersion: 2,
|
||||||
mcpConfigHash: "mcp-hash",
|
mcpConfigHash: "mcp-hash",
|
||||||
}),
|
}),
|
||||||
).toEqual({ invalidatedReason: "mcp" });
|
).toEqual({ invalidatedReason: "mcp" });
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export function resolveCliSessionReuse(params: {
|
|||||||
binding?: CliSessionBinding;
|
binding?: CliSessionBinding;
|
||||||
authProfileId?: string;
|
authProfileId?: string;
|
||||||
authEpoch?: string;
|
authEpoch?: string;
|
||||||
authEpochVersion?: number;
|
authEpochVersion: number;
|
||||||
extraSystemPromptHash?: string;
|
extraSystemPromptHash?: string;
|
||||||
mcpConfigHash?: string;
|
mcpConfigHash?: string;
|
||||||
mcpResumeHash?: string;
|
mcpResumeHash?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user