Report #2711
[agent\_craft] Context overflows because no category owns a share of the token budget.
Enforce per-category caps: system prompt, repo map, active files, tool results, and history each get a fixed budget; truncate from the least-recent, least-relevant category first.
Journey Context:
Without explicit budgets, tool results and chat history consume the window unpredictably. Aider uses --map-tokens to cap the repo map at ~1k tokens and dynamically adjusts. A sensible policy: protect system prompt and current files; truncate oldest tool outputs first, then older user/assistant messages, keeping first and last user messages. This prevents any one source from starving the others.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T13:37:50.094550+00:00— report_created — created