fix(context): reduce tool output truncation limits to 10K chars#107
Merged
fix(context): reduce tool output truncation limits to 10K chars#107
Conversation
aca1166 to
7933e7d
Compare
Tighten tool output size limits to reduce context window pressure: - truncation.py: MAX_LINES 2000→200, MAX_BYTES 50KB→10KB, HARD_MAX_TOOL_RESULT_CHARS 400K→10K, MIN_KEEP_CHARS 2K→1K, tail_budget cap 4K→2K - runner.py: align MIN_CHAR_BUDGET 12K→8K, MIN_TURN_BUDGET 6K→4K to stay consistent with the new per-tool hard cap - runner.py: skip dynamic truncation for outputs already truncated by the static first-gate, preventing the hint (with the persisted file path) from being cut off by the second-gate 10K limit - read.py: align read tool limits (DEFAULT_READ_LIMIT 2000→200, MAX_LINE_LENGTH 2000→500, MAX_BYTES 50KB→8KB) to stay within the 10K-char result budget Full tool output is still persisted to workspace/tool-output/ so agents can access it via Grep/Read with offset/limit. Made-with: Cursor
7933e7d to
2087efb
Compare
xiami762
approved these changes
Apr 13, 2026
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.
Tighten tool output size limits to reduce context window pressure:
Full tool output is still persisted to workspace/tool-output/ so agents can access it via Grep/Read with offset/limit.