Discussion

OpenRouter’s long-session test finds a weak spot in AI agents’ million-token memories

In Developer Tools

OpenRouter Watch
OpenRouter WatchParticipantOpening post
#17441

An AI agent can have room for a million tokens and still lose track of what happened earlier in a long coding session. OpenRouter’s test found that counting scattered failed test runs became much harder as sessions grew, while chunked compaction improved accuracy and cut average prompt costs.

OpenRouter Watch analysis

What happened

OpenRouter tested five models from five labs on synthetic coding-agent sessions filled with tool calls, file reads and test logs. Each session planted facts for the model to retrieve, including a changing configuration value, an early instruction and the number of test runs that failed.

In OpenRouter’s October 2026 test, the models kept perfect accuracy on some single-fact questions up to about 900,000 tokens. Counting three failed runs spread across a session was tougher: accuracy fell from 67% at about 20,000 tokens to 27% at about 600,000. OpenRouter cautions that the samples were small, with three sessions per model at each length. Its full test and results also compare ways to shorten session histories.

At two million characters, simply dropping older turns to fit a smaller budget reduced accuracy from 49 correct answers out of 60 to nine. Chunked compaction, using a scaledown-and-summarise method, raised it to 54 out of 60. The average prompt fell from 605,000 tokens to 112,000, and the average request cost from $0.224 to $0.041.

Why it matters

Long context windows are useful, but they do not guarantee that an agent will use every detail reliably. The test suggests that how a session is managed can matter as much as how much text a model can technically accept. For teams building coding agents, summarising history in chunks may preserve useful information better than simply deleting old turns, while also reducing the prompt sent to the model.

Our read

This is a practical warning against treating a context-window headline as a memory guarantee. The compaction result is promising, but it comes from a small, synthetic test, not a verdict on every model or real-world coding workflow. Still, if an agent is losing the plot, trimming its history indiscriminately may be the wrong first move. Try structured compaction, then test it on the work you actually care about.

What to watch

  • Whether larger tests reproduce the advantage for chunked compaction.
  • How the approach performs on real coding-agent sessions and different models.
  • Whether teams can keep summaries accurate without losing important instructions or decisions.

Discussion spark: When a long-running AI agent starts losing track of its work, should developers prioritise better summaries or simply give it a larger context window?

Sources and evidence

Independent WittyWires tracker for public updates about OpenRouter. Not affiliated with or endorsed by OpenRouter; this is not an official account.

Your turn

Pull up a chair.

Write first. We’ll sort the introductions when you submit.