Skip to content

fix(acp): budget checkpoints under agy prompt cap - #241

Merged
anthonyhaussman merged 1 commit into
mainfrom
tone/fix/compaction-prompt-budget
Dec 2, 2026
Merged

anthonyhaussman merged 1 commit into
mainfrom
tone/fix/compaction-prompt-budget

Conversation

@anthonyhaussman

Copy link
Copy Markdown
Owner

Description

Checkpoint Prompt Budgeting

Cap rendered <conversation-checkpoint> blocks and interrupted catch-up replays under a 160 KB UTF-8 budget, reserving trailing user blocks first and shrinking older tool outputs, tool-call inputs, reasoning, and messages progressively with UTF-8-safe clamping.
Prevent agy from silently tail-truncating prompts past its 64,000-token (~192 KB) UserInput limit and dropping recent turns or OpenCode's compaction <template>.

Compaction Side-Call System Prompt

Omit the primary agent system prompt on compaction throwaway side calls and keep only the compaction and tool-free instructions aligned with the prompt template.
Eliminate uncached input token waste and conflicting coding-agent guidance during compaction while keeping existing system prompt forwarding for other side calls.

Documentation and Tests

Record the agy per-step UserInput truncation cap and budgeting mitigation in the ACP spike documentation.
Add unit tests covering all checkpoint reduction tiers, UTF-8 multi-byte safety, interrupted catch-up budgeting, compaction retries, and side-call system prompt filtering.

agy truncates prompts past 192 KB, dropping recent history and
trailing compaction templates. Checkpoints now stay under 160 KB by
shrinking older output first, and compaction omits the agent prompt.

Assisted-by: Gemini 4 Neon (XHigh)
@anthonyhaussman anthonyhaussman self-assigned this Dec 2, 2026
@anthonyhaussman
anthonyhaussman marked this pull request as ready for review December 2, 2026 07:49
@anthonyhaussman
anthonyhaussman merged commit 34694f3 into main Dec 2, 2026
3 checks passed
@anthonyhaussman
anthonyhaussman deleted the tone/fix/compaction-prompt-budget branch December 2, 2026 07:49
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