Skip to content

Commit 62d8f47

Browse files
committed
fix: reseed Claude CLI session context on rotation closes #80905
1 parent abb4f96 commit 62d8f47

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

extensions/anthropic/cli-backend.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function buildAnthropicCliBackend(): CliBackendPlugin {
6363
imagePathScope: "workspace",
6464
sessionArg: "--session-id",
6565
sessionMode: "always",
66+
reseedFromRawTranscriptWhenUncompacted: true,
6667
sessionIdFields: [...CLAUDE_CLI_SESSION_ID_FIELDS],
6768
systemPromptFileArg: "--append-system-prompt-file",
6869
systemPromptMode: "append",

extensions/anthropic/cli-shared.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,15 @@ describe("normalizeClaudeBackendConfig", () => {
261261
expect(backend.resolveExecutionArgs).toBe(resolveClaudeCliExecutionArgs);
262262
});
263263

264+
it("opts bundled Claude CLI into bounded raw transcript reseed without disabling native resume", () => {
265+
const backend = buildAnthropicCliBackend();
266+
267+
expect(backend.config.reseedFromRawTranscriptWhenUncompacted).toBe(true);
268+
expect(backend.config.sessionMode).toBe("always");
269+
expect(backend.config.resumeArgs).toContain("--resume");
270+
expect(backend.config.resumeArgs).toContain("{sessionId}");
271+
});
272+
264273
it("leaves claude cli subscription-managed, restricts setting sources, and clears inherited env overrides", () => {
265274
const backend = buildAnthropicCliBackend();
266275

0 commit comments

Comments
 (0)