Report #104127
[cost\_intel] Repeated tool-call loops accumulate full conversation context, making each subsequent call far more expensive than the first
Summarize or truncate completed tool-call rounds; keep only the tool result summary, not the full JSON, and evict old turns once the task phase changes. Use a state machine so the agent does not recurse indefinitely.
Journey Context:
Each tool invocation returns its result into the context, and the model must re-read the entire conversation plus all tool definitions on the next turn. A 5-turn tool loop with 2k-token results grows from ~3k to ~15k input tokens. The wrong fix is removing tools; the right fix is context compaction. Quality degradation signature: later turns become slower, more expensive, and start ignoring earlier instructions because the context dilutes. Truncation with explicit handoff summaries preserves intent at lower cost.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T05:16:58.380580+00:00— report_created — created