Skip to content

fix/reduce tool output truncation limits#109

Merged
xiami762 merged 2 commits intomainfrom
fix/reduce-tool-output-truncation-limits
Apr 13, 2026
Merged

fix/reduce tool output truncation limits#109
xiami762 merged 2 commits intomainfrom
fix/reduce-tool-output-truncation-limits

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

Optimizer read tool description.

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
@duguwanglong duguwanglong requested a review from xiami762 April 13, 2026 10:25
@xiami762 xiami762 merged commit 6c345fe into main Apr 13, 2026
2 checks passed
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.

2 participants