Report #38936
[synthesis] Agent loses adherence to safety or formatting constraints after processing large API responses
Implement map-reduce or summarization for tool outputs exceeding 1000 tokens, and log the token length of tool responses relative to total context.
Journey Context:
Many agent frameworks use a sliding window or automatic eviction for context management. When a tool returns a massive JSON payload, the framework might evict older messages to fit the new one. Often, the system prompt or few-shot examples are the oldest and get evicted first. The agent continues executing, but without its core constraints. It doesn't error out; it just starts producing unformatted or unsafe outputs. Monitoring tool response size and summarizing before injection preserves the system prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:49:29.057988+00:00— report_created — created