Repository navigation
fix(agent): name the real budget shortfall when compaction cannot fit - #1678
Merged
Merged
Conversation
The refusal at small windows said "split large input material or use a new session", but neither helps: `summary_budget` (`window/8`) is compared to and clamped by nothing except `summary_cap`, so on a 40 960-token window with ~26 K of fixed context (system prompt, tool definitions, project context) the summary alone (5 120) exceeds a `maximum_target` derived from the 4.7 K of history left (3 539). The conversation size is irrelevant. Report the three quantities that actually conflict instead - fixed context, remaining history, summary request - plus `required` and `maximum_target`. No arithmetic changes: `summary_budget`, `maximum_target`, `hard_limit` and the retained-original demotion are untouched; only the `format!` content (and its comment) differs. Pinned by `impossible_budget_error_names_the_window_shortfall_not_the_user_input`, which fails on the old string (both remedies must be absent) and passes on the new one.
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.
Summary
Compaction on a small context window could fail with advice the user cannot act on: "split large input material or use a new session". When the fixed context (system prompt, tool definitions and project context) already dominates the window, neither remedy changes anything. The budget error now names the three quantities that actually conflict, so the message points at the real cause.
Commits
Verification
cargo fmt -p future-agent --check— passcargo clippy -p future-agent --all-targets -- -D warnings— passcargo test -p future-agent --lib— 3127 passed, 0 failed, 7 ignoredUser-visible changes
8732bbede.