Repository navigation
fix(acp): budget checkpoints under agy prompt cap - #241
Merged
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
agyfrom silently tail-truncating prompts past its 64,000-token (~192 KB)UserInputlimit 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
agyper-stepUserInputtruncation 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.