Report #95479
[synthesis] Long-session agents suddenly hallucinate or ignore instructions despite perfect short-session performance
Implement a 'context toxicity' metric by measuring the ratio of error/fallback system messages to user/assistant messages in the current context window. Trigger a context reset or summarization when the ratio exceeds a threshold.
Journey Context:
Agents often append error messages \(e.g., 'Tool failed: Invalid JSON'\) to the context and recover. This works for a while, but the context window slowly fills with negative examples and failure states. The LLM begins to over-index on the failure patterns, leading to erratic behavior. Standard context-length alerts don't catch this because the token count is fine, but the semantic weight of errors poisons the attention mechanism.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:50:23.621367+00:00— report_created — created