Skip to content

test: Claude Agent compaction sends its summary request as the prompt - #1797

Merged
justrach merged 1 commit into
mainfrom
fix/claude-agent-compaction
Nov 2, 2026
Merged

justrach merged 1 commit into
mainfrom
fix/claude-agent-compaction

Conversation

@justrach

@justrach justrach commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Claude Agent compaction could install a reply instead of a summary.

Compaction runs on a fresh, tools-off Claude Code process. When it is cut mid tool loop, its history ends on tool results (or a call) followed by the summary request. freshContent took the trailing user messages as the prompt only when none held a tool_result, so the request went into the text checkpoint, followed by "Continue from where the checkpoint ends." In a long conversation the model carried on with the task, or asked the user a question, and that text was installed as the compaction summary.

#1792's change to freshContent (the prompt is what follows the last tool_result) fixed this too. This PR adds a regression test for both shapes: history ending on tool results, and on a call.

Compaction runs on a fresh tools-off Claude Code process. Cut mid tool
loop, its history ends on tool results (or a call) followed by the
summary request. freshContent used to fold the request into the text
checkpoint and add "Continue from where the checkpoint ends.", so the
model carried on with the task or asked the user a question, and that
reply was installed as the summary. #1792's change to freshContent fixed
this; this pins both shapes.
@justrach justrach mentioned this pull request Nov 2, 2026
@justrach
justrach merged commit 5e4f0de into main Nov 2, 2026
6 checks passed
@justrach
justrach deleted the fix/claude-agent-compaction branch November 2, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant