Report #72267
[synthesis] Agent loops derail silently when tool outputs exceed context limits without raising an error
Implement token counting on tool outputs before injecting into context; summarize or truncate aggressively, and log a warning metric for context overflow truncation.
Journey Context:
Agents often fail silently because LLM APIs truncate context or shift the window, dropping the system prompt. Developers assume tool errors will be explicit, but context overflow is a silent, non-exceptional failure mode. Truncating tool output is controversial because it might drop critical data, but losing the system prompt \(which contains the goal and constraints\) is a catastrophic failure that leads to hallucinated loops. Therefore, preserving the system prompt at the cost of tool output fidelity is the right tradeoff.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:52:58.695393+00:00— report_created — created