Date: 2026-02-04
Version: 2026.2.2-3
Severity: High (breaks agent completely)
Summary
Large tool outputs are not truncated before being added to context, causing sessions to overflow the 200k token limit even with compaction enabled.
Reproduction
- Use
sessions_list with many sessions or gateway config.get repeatedly
- Session file grows unbounded
- Eventually hits
HTTP 400 invalid_request_error: prompt is too long: 225881 tokens > 200000 maximum
Evidence
From session session-id (4.5MB):
| Line |
Size |
Tool |
| 877 |
1.1MB |
sessions_list |
| 857 |
640KB |
gateway (config.get) |
| 357 |
616KB |
gateway (config.get) |
| 319 |
266KB |
exec |
Compaction ran 4 times but couldn't shrink single-turn payloads.
Config
"compaction": {
"mode": "safeguard",
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 20000
}
}
Expected Behavior
- Tool outputs should be truncated to a reasonable size (e.g., 50KB) before context insertion
- Or compaction should aggressively summarize/drop large tool results
- Warning when a single tool call exceeds threshold
Suggested Fix
- Add maxToolOutputBytes config (default ~50KB)
- Truncate with [truncated: X bytes remaining] indicator
- Log warning when truncation occurs
Workaround
Run /new to start fresh session. Archive old sessions manually.
Date: 2026-02-04
Version: 2026.2.2-3
Severity: High (breaks agent completely)
Summary
Large tool outputs are not truncated before being added to context, causing sessions to overflow the 200k token limit even with compaction enabled.
Reproduction
sessions_listwith many sessions orgateway config.getrepeatedlyHTTP 400 invalid_request_error: prompt is too long: 225881 tokens > 200000 maximumEvidence
From session
session-id(4.5MB):sessions_listgateway(config.get)gateway(config.get)execCompaction ran 4 times but couldn't shrink single-turn payloads.
Config
Expected Behavior
Suggested Fix
Workaround
Run /new to start fresh session. Archive old sessions manually.