Author’s note: The facts in this article come from OpenRouter’s context rot tutorial published on 2026-12-01, whose test runs are dated 2026-10-22. The sample isn’t large, and the author themselves notes it can only show direction, not serve as precise accuracy rates.

Why long-session AI Agents get dumber: four numbers up front
Anyone who’s written a coding Agent has probably hit this scene: the session runs into its second or third hour, and the model starts misremembering ticket numbers, treats files it already changed as untouched, and counts “those three failures just now” as four. Your first instinct is that the context window isn’t big enough, so you switch to a bigger window and a stronger model — and the problem still resurfaces after some length.
OpenRouter published a tutorial on 2026-12-01 that calls this phenomenon context rot. The test runs in the article were done on 2026-10-22; the author used five models with contexts near 1 million, ran them over a synthetic coding-agent session log, and ran only three seeds per length. This isn’t an industry leaderboard — small sample, few models, limited length tiers — but it’s good enough to read the direction.
Its conclusion is counterintuitive: the model doesn’t get dumber as a whole — a few kinds of problems break first. Single-fact recall holds up almost to the end, while problems that require accumulating across the whole session start losing points very early. This article breaks that difference apart, then lays out a three-step approach for moving the “ledger” out of the context.
| Observation | Specific numbers | What it means for you |
|---|---|---|
| Single-fact recall | 15/15 at every length, 9/9 at the longest tier | Info you can pull out in one sentence — ticket numbers, final config values — still basically holds up in long sessions |
| Cross-segment counting | ~20K tokens: 67%, ~80K tokens: 40%, ~600K tokens: 27% | Ledger-style questions like “how many failures total” start collapsing much earlier than you’d expect |
| Trimming old messages | 2M characters drops from 49/60 to 9/60 | The most aggressive token-saving move, at the cost of nearly cutting memory away entirely |
| Chunked summarization | 54/60, average prompt drops from 605K to 112K tokens | The more cost-effective compromise for now, but it likewise can’t preserve every count |
Of these four rows, the one worth remembering most is the second. The “only 40% right at 80K tokens” in the headline refers to it scoring just 6/15 at the ~80K token tier — that is, 40%. 80K tokens doesn’t count as a long session these days; a mid-sized refactoring task easily gets there, which is exactly what makes this number uncomfortable.
What Long-Conversation AI Agents Remember: The Divide Between Single-Point Facts and Cross-Segment Counting
The four test questions are pretty plain, and all of them are buried in the same synthetic conversation transcript. The first asks for ticket number OPS-4471. The second asks whether the final value of MAX_WORKERS is 14. The third asks about the rule at the start of the conversation: “don’t modify src/billing.” The fourth asks, “How many test failures were there in total, and how many times did the three-failure case show up?”
The first three are single-point facts: the answer appears verbatim in a sentence, and the model just has to locate that sentence to get it right. The fourth is different. It requires the model to find every failure across the whole history, deduplicate them, and add them up. If any one instance gets lost in the noise, the answer can go wrong.
| Question type | ~20K tokens (64K characters) | ~80K tokens (256K characters) | ~600K tokens (2M characters) |
|---|---|---|---|
| Ticket number OPS-4471 | 15/15 | 15/15 | 15/15 |
| Final MAX_WORKERS value of 14 | 15/15 | 15/15 | 15/15 |
| “Don’t modify src/billing” at the start | 15/15 | 15/15 | 15/15 |
| Number of three-failure test occurrences | 10/15 (67%) | 6/15 (40%) | 4/15 (27%) |
This table makes one thing clear: when people say “long conversations get dumber,” not every capability degrades at once. The first three rows stay at a perfect score, which means the model can still find and repeat a specific fact in a long context. The drop in the fourth row shows that it’s fragile at cross-segment aggregation.
The author also mentions a detail: the longest tier (3.2 million characters) only ran three models, because Claude Haiku 5.5 straight-up returned a 400. The error said 1294690 tokens exceeded the 1M limit. In other words, just because the window says 1M doesn’t mean you can actually use the full 1M. Once you go over, it’s a hard error, not a silent downgrade. At this tier, the three single-point questions were still 9/9, which means that as long as the request goes through, fact recall still holds up.
Another detail that shouldn’t be overlooked is MiniMax M3.1 Flash. It stayed at 10 or 11/12 across all lengths, and its degradation was clearly smaller than the other models. One caveat here: 12 is its own sample size, so don’t directly compare it with the other models’ 15 as a magnitude. All you can say is that its curve is flatter.
Why “count to three” is so hard: the model is re-counting, not checking the books
The key difference is that the model doesn’t have a ledger. Every time you ask “how many times did it fail,” it has to go back into the context, rescan, and re-add. When the context is short, the relevant passages sit next to each other and one pass is enough. When the context gets long, the same information is diluted by piles of unrelated tool output, log fragments, and file contents — and the model either misses one occurrence or double-counts the same failure.
What’s worse is the shape of its errors. It won’t just say “I’m not sure.” It gives you a number that looks entirely plausible. In the history-pruning case, the author even watched the model fabricate a ticket number, SEC-8492, that doesn’t appear anywhere in the text. Fabrication is far more dangerous than silence, because your agent will take that fake ticket number and keep working with it.
This is a judgment call, not a measured conclusion: accounts that span an entire session — occurrence counts, which files were changed — should be maintained in external state, not left to the model to re-count from history every time. What the model is good at is “one glance and you know.” What it’s bad at is “adding up ten things scattered across 400,000 tokens.”

Putting it into practice: the external-state block on the right side of this diagram is the core of the three-step approach. If you want to find out at what length your own sessions start to degrade, grab a free trial quota on APIYI apiyi.com and run the same session transcript twice with different thresholds — far more reliable than picking a number by gut feel.
Truncating History vs. Chunked Summarization: 49/60, 9/60, and 54/60 Have to Be Read Together
When context gets long, there are two common engineering approaches: one is to chop off old messages and keep only the most recent stretch; the other is chunked summarization, which compresses the early content into a summary and puts it back in. The author compared both approaches against full retention at the 2-million-character tier.
| Strategy | Total score | Avg. prompt tokens | Avg. cost per request | Avg. time per request |
|---|---|---|---|---|
| Full retention | 49/60 | 605K | $0.224 | 20.4 sec |
| Keep only the most recent ~120K characters | 9/60 | Not given in the article | Not given in the article | Not given in the article |
| Chunked summarization | 54/60 | 112K | $0.041 | 6.5 sec |
These three numbers have to be read together. Remember only 54/60 and you’ll walk away with the illusion that “summarization has solved the problem”; remember only 9/60 and you’ll conclude that “compression is useless.” The real picture is this: truncating history cuts memory far too aggressively, and all three items — ticket IDs, the latest MAX_WORKERS, and failure counts — drop to 0/15. Chunked summarization preserves most of the memory and even scores slightly higher than full retention overall, but on the “count the number of times” item it only gets 9/15.
In other words, summarization improves “can it be found,” but it doesn’t solve “can it be counted accurately.” The author says as much in the article: information like counts should still go into state, because a summary can’t preserve every count.
Chunked summarization isn’t free either. The compression step itself has to run once, costing about $0.023 and 88 to 124 seconds per session. What you save is the prompt length of every subsequent request, dropping from 605K tokens to 112K, with per-request cost falling from $0.224 to $0.041 and latency from 20.4 seconds to 6.5 seconds. The longer the session and the more follow-up questions, the easier it is to amortize that upfront investment.
There’s also a counterexample that’s easy to overlook: GPT-6 Luna went from 10 points to 9 after summarization. Not every model gets better with summarization — for some, it’s actually a loss of information. So when you switch strategies, validate each model separately rather than applying a one-size-fits-all rule.

Long-Conversation AI Agents: A Quick Start — Three Steps to Keep the Ledger in State
Step 1: Trigger chunked summaries on a token threshold before you hit the window limit
Don’t wait for a 400 error to deal with it. The 1294690-token example above shows that blowing past the limit is a hard failure — a session that’s been running for two hours can just die right there. A steadier approach is to set a threshold well below the cap, say 40% or 50% of the window, and trigger a chunked summary: compress the early sections into conclusions, then keep going.
Don’t copy someone else’s numbers for that threshold — set it based on the shape of your own task. For sessions where tool output dominates, compression pays off big, but the risk of losing detail is high too; for sessions that are mostly conversation with clear conclusions, compression is nearly lossless.
Step 2: Keep user rules and current config in the system prompt or a separate state object
Rules like “don’t touch src/billing” typically get said once at the start of the session, then buried under tens of thousands of tokens of tool output. Same goes for config like MAX_WORKERS that gets changed several times mid-session, where only the final value counts. Writing these into the system prompt, or putting them in a separate config object that rides along with every request, is far more reliable than hoping the model will dig up a single sentence from hundreds of thousands of tokens ago.
This step costs almost nothing, since the rules and config are short — the bump they add to prompt length is negligible. But it turns the most easily lost category of information into something reliably available.
Step 3: Track failure counts and touched files in state so the model doesn’t have to recount
Maintain two things in a small dict or JSON: a failure counter, and a list of “which files have already been changed.” Update it every time a tool call returns, and stuff that chunk of state into the prompt whenever the model needs to make a judgment. That way the model doesn’t have to recount — it just reads a number.
No special handling is needed on the client side. Point base_url at https://api.apiyi.com/v1 and use the same API key to switch between several models, which makes it easy to check how the same state scheme performs across different models.
| What to track | Where to put it | Why the model can’t just pull it from history |
|---|---|---|
| User rules, off-limits directories | System prompt or separate config | Usually stated once at the start, then diluted by massive output |
| Final value of current config | Separate state object | Changed several times mid-session; the model tends to answer with an old value |
| Failure count | External counter | Needs to accumulate across the whole session; the longer the chat, the easier it is to miss or double-count |
| List of modified files | Change list | The model tends to treat “planning to change” as “already changed” |
Suggestion: The step most likely to get skipped is the first one, because it requires you to estimate a threshold up front. To save yourself the trial-and-error, run the same long session on the free quota at APIYI apiyi.com, setting the threshold at 30%, 40%, and 50% of the window, and see which one starts losing points on counting questions first.
How to Calculate the Cost of a Long-Conversation AI Agent: Don’t Mix the Two Price Sheets
First, let’s be clear about one thing: the $0.224 and $0.041 in that OpenRouter article are the author’s per-request cost calculated from their own catalog prices at the time. The price used in the chunked summarization step was $0.04 / million tokens for input with free output, dated 2026-10-22. That’s the accounting internal to that particular test — change the platform or change the date and it no longer holds.
APIYI apiyi.com’s master table on 2026-12-03 is a completely different set of numbers, priced per model in USD per million tokens:
| Model | Input | Output | Cache read | Tier and endpoint notes | Available platform |
|---|---|---|---|---|---|
| claude-haiku-5-5 | $0.1 | $0.5 | $0.01 | Input $0.1 up to 100K tokens, $0.5 beyond that | APIYI apiyi.com |
| gpt-6-luna | $0.1 | $0.5 | $0.01 | Input $0.1 up to 272K tokens, $0.2 beyond that; endpoints are mainly responses, chat is also available | APIYI apiyi.com |
| gemini-3.8-flash | $0.75 | $3.75 | $0.075 | No tiers | APIYI apiyi.com |
| deepseek-v4.1-flash | $0.3 | $1.2 | $0.006 | No tiers | APIYI apiyi.com |
| MiniMax-M3.1-Flash | $0.15 | $0.6 | $0.015 | No tiers | APIYI apiyi.com |
Mixing the two sets of numbers will lead you to completely wrong conclusions. The sensible approach: take the price sheet of the platform you actually call, multiply by your real prompt-length distribution and your call volume, then decide whether it’s worth paying extra compression cost for summaries. APIYI apiyi.com runs an OpenAI-compatible interface with pay-as-you-go billing — swap only the base_url in the same code and you can compare several models side by side on the same long conversation, which is far more informative than staring at unit prices in someone else’s table.
FAQ
Q1: What is context rot?
It means that in a long session the model doesn’t get dumber across the board — certain capabilities that depend on aggregating information across segments degrade first. Single-point fact recall basically holds up, but questions that require accumulating evidence across the whole history lose points noticeably, and the failure mode shifts from “can’t answer” to “makes up a plausible-looking answer.”
Q2: Why are single facts fine while counting occurrences collapses first?
A single fact can be lifted verbatim out of one sentence — find it and you’re right. Counting requires locating every failure scattered throughout the history, then deduplicating and summing them; if any one of those spots gets diluted by irrelevant content, the count is wrong. The two aren’t in the same difficulty class, so their degradation points are far apart.
Q3: Isn’t trimming old messages more token-efficient?
It does save tokens, but the cost shows up in memory. At the 2 million character tier, trimming down to only the most recent ~120,000 characters dropped the total score from 49/60 to 9/60 — ticket numbers, the latest MAX_WORKERS value, and failure counts all went to 0/15, and it even fabricated a ticket number, SEC-8492, that doesn’t exist in the text. This path suits tasks that “only care about the last few steps,” not coding agents that need to keep accounts across segments.
Q4: Can chunked summarization solve it completely?
No. Summarization raised the total score from 49/60 to 54/60 and cut prompt length from 605,000 to 112,000 tokens, but it can’t preserve all the counts — the counting questions scored only 9/15. And not every model benefits: GPT-6 Luna actually went from 10 points to 9. Summarization solves “can it be found,” not “is it counted accurately.”
Q5: How do I quickly compare several models on the same long session?
Prepare a fixed session log and a set of standard questions, run them through the OpenAI-compatible interface, point base_url at https://api.apiyi.com/v1, change only the model name, and keep every other parameter identical. That way the differences you see are model differences, not prompt-writing differences. After registering through APIYI apiyi.com you can get a Key and free test credits right away.
Q6: Can this run be treated as an industry verdict?
Not recommended. The author explicitly states that each length was run with only three seeds, across five models, with a limited set of length tiers — this is a directional observation, not a precise accuracy measurement. It can tell you the trend of “which kinds of questions break first,” but it can’t tell you “model X has exactly 40% accuracy at 80K tokens.” If you really want a conclusion, repeat the test on your own task.
Q7: When should I just start a new session?
When the task boundary is clear and past history no longer affects subsequent judgments, starting a fresh session is cleaner than any amount of compression. The test is: does the upcoming work still need to reference rules set at the beginning, configs changed midway, and the failure counts accumulated along the way? If none of those apply, write the conclusions into a handoff note and start over.
Long-Conversation AI Agent Key Takeaways
- Degradation isn’t uniform: Single-point facts stay correct all the way to the longest tier, while cross-segment counting drops to four in ten at around 80K tokens.
- A window isn’t the same as usable capacity: A 1M context window throws an outright 400 at 1294690 tokens — going over the limit is a hard failure, not graceful degradation.
- Trimming history is the most expensive move: The 2M-character tier drops from 49/60 to 9/60, all three key facts go to zero, and it starts fabricating ticket numbers.
- Summarization helps but doesn’t cure it: 54/60, with prompts down to 112K tokens, yet counting is still only 9/15 — and not every model gets better.
- Keep the books outside the model: Rules, final config values, failure counts, files already changed — write them into the system prompt or a separate state, and don’t make the model recount.
- How to get started: Use the OpenAI-compatible interface, swap
base_urltohttps://api.apiyi.com/v1, and grab free quota on APIYI apiyi.com to validate your thresholds.
Summary
Long-conversation AI agents getting dumber isn’t a uniform downward slope — it’s “can remember” and “can compute” splitting off from each other:
- Single-point facts: As long as the request actually gets through, information like ticket numbers and final config values is still answered correctly at every length.
- Cross-segment counting: About 67% at 20K tokens, only 40% at 80K, down to 27% at 600K — this is the first category to collapse.
- Compression strategy: Trimming history gives 9/60; chunked summarization gives 54/60. The former saves more but remembers less; the latter is the better deal but still needs external state as a backstop.
If your agent needs to stay reliable across long conversations, move failure counts and already-changed files into state first, then consider a compression strategy — get the order backwards and you’ll waste your effort. If you want to see how different models perform on your own conversations before you start building, grab some free quota at APIYI apiyi.com and run a comparison round.
References
-
OpenRouter Blog – Context Rot: Why Your AI Agent Gets Worse in Long Sessions: The primary source of facts for this discussion; test runs dated 2026-10-22
- Link:
openrouter.ai/blog/tutorials/context-rot/ - Notes: Covers the design of the four questions, accuracy at each length, and comparison data between history pruning and chunked summarization
- Link:
-
APIYI Price Master List: Version 2026-12-03, listing input, output, and cache-read prices by model, along with tiered pricing notes
- Link:
apiyi.com - Notes: Used to estimate actual invocation costs; these prices should not be confused with the list prices in the OpenRouter tests
- Link:
-
OpenAI-Compatible API Documentation: Explains standard usage of base_url and API key
- Link:
docs.apiyi.com - Notes: Suitable for scenarios that require switching between multiple models for comparative testing
- Link:
Author: APIYI Technical Team
Technical Discussion: Feel free to contact us via the APIYI homepage; more resources are available in the docs.apiyi.com documentation center
