Report #42411
[synthesis] Agent loops derail silently when tool outputs exceed context window limits
Implement streaming context truncation or summarization of tool outputs before appending to the message history, and enforce a hard token limit on tool return payloads.
Journey Context:
Agents often fail silently because the LLM API truncates the middle or start of the context, losing the system prompt or original user goal. Developers assume the API throws an error on context overflow, but most APIs silently truncate or return a generic 400, leaving the agent with amnesia. By capping tool output size and summarizing intermediate steps, the agent retains its core directive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:39:29.392678+00:00— report_created — created