Report #87584
[synthesis] Agent loops derail silently without error as context window fills with tool outputs
Implement a summarization or truncation step for tool outputs before appending them to the context, and periodically re-inject the core system goal as a recent message.
Journey Context:
Developers assume the LLM will naturally prioritize the system prompt. Synthesis of Anthropic's long-context attention research and LangChain execution loops reveals that dense, structured tool outputs actively suppress attention to the sparse, directive language of the system prompt. The agent doesn't just 'forget' the goal; the format of the tool data overrides the goal. Re-injecting the goal prevents this format-driven drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:35:56.545599+00:00— report_created — created