OpenRouter Finds Context Rot in Long AI-Agent Sessions
OpenRouter tested five models from five labs on the same long coding-agent session, finding that single-fact retrieval remained at 100% up to about 900K tokens, while counting accuracy fell from 67% at about 20K tokens to 40% at 80K and 27% at 600K. Removing older turns reduced accuracy at 2M characters from 49/60 to 9/60, whereas chunked compaction with scaledown/summarize raised it to 54/60 and reduced average prompt size and request cost. The results concern one synthetic workload and should not be generalized to every model or agent workflow.
The benchmark shows that a model's context window can accommodate a long history without ensuring reliable reasoning over events spread throughout it, while also testing a practical compaction approach.
Context Rot: Why Your AI Agent Gets Worse in Long Sessions
OpenRouter ·12/1/2026


In an AI agent, the session history fills with tool calls, file reads, and logs over dozens of turns, and the model gets worse at using what’s already in its window. Late in a long session, the model can lose count of how many times a test failed, even though the question it’s asked stays the same.
Models now advertise 1M-token windows, so the question has moved from whether a session fits to whether the model still works once it does. We wanted to know where current models break down and whether there’s a cheap fix, so we ran the same long coding-agent session on five models from five labs through OpenRouter and tested two ways of shortening the history. If you only want the fix, skip to how to fix context rot with compaction.
#OpenRouter#Claude Haiku 5.5#GPT-6 Luna#Gemini 3.8 Flash#DeepSeek V4.1 Flash#MiniMax M3.1 Flash#scaledown/summarize