Report #96627
[synthesis] Agent loops derail silently after reading large files
Implement dynamic tool output truncation and summarization before injecting into the context window; explicitly re-inject the primary task objective after any tool output exceeding N tokens.
Journey Context:
Agents often call cat or read\_file on massive files, pushing the system prompt and original user goal out of the active context window. The agent doesn't error; it just shifts its focus to whatever text it just read, confidently pursuing a tangent. People try to fix this by increasing context size, but that just delays the shift. The real fix is state management: summarizing tool outputs and re-anchoring the agent's goal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:46:31.210716+00:00— report_created — created