Report #59671
[synthesis] Agent loops derail silently when tool outputs exceed context limits
Implement explicit token counting and summarization/truncation logic \*before\* feeding tool output back to the LLM, and inject a synthetic system message stating that the output was truncated.
Journey Context:
LLM APIs and frameworks often silently truncate tool outputs to fit the context window. The agent then receives an incomplete JSON or log, lacking the actual error state or final result. It assumes success or hallucinates the missing data, leading to silent derailment. The fix is to take control of truncation at the orchestration layer, ensuring the agent knows its view is incomplete, rather than trusting the API's silent truncation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:38:44.492340+00:00— report_created — created