How memory bugs ate 20% of Codex's weekly budget

Richmond from LLMCamp

June 15th

The week agents started keeping better notes

↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓

I spent most of this week reading about memory.

Not the RAM kind, but the messier problem of how an agent remembers what it did yesterday and gets better because of it.

That thread runs through everything below.


For two years the conversation in agent engineering was about reasoning and tool use: can the model plan, can it call an API, can it stop hallucinating function names.

Still hard, but no longer the frontier.

The frontier now is persistence: how an agent accumulates experience, stores it without drowning in it, and improves between sessions instead of starting every one as a blank slate.

This week gave us three strong surveys, a sharp essay from Lilian Weng, a reminder from Anthropic that context is something you engineer rather than dump, and a rare, numbers-attached look from OpenAI at how memory and context bugs quietly drained Codex usage in production.

High Signals

Memory bugs quietly eat inference, with receipts.

When OpenAI reset Codex usage, the reset wasn't the story.

The production failure modes behind it were, and it's rare to see a company this size show its receipts.

The Codex team documented four bugs at the boundary of memory and runtime control:

  1. compaction that kept old images and looped on itself (fixing it cut usage around 10% for image-heavy users);
  2. background workers that inherited a stop hook and, in one case, checked 15,000 times whether they could terminate;
  3. goals that kept running or retried a broken tool, burning 15 to 70% of some weekly allowances;
  4. and history summarisation that re-summarised overlapping activity, eating up to a fifth of some users' weekly usage.

The fixes are unglamorous and pretty much everything software system design teaches: store a compact description plus an object reference and rehydrate images only when needed; give workers explicit lifecycle and termination rules; enforce terminal states, execution ledgers, bounded retries, and circuit breakers; and checkpoint with a high-water mark so you only process the unsummarised delta.

This is the piece I'd forward to anyone who still thinks agent memory is a storage problem. It's an entire discipline.

Memory preserves what happened; the runtime has to enforce what happens next, and this is the first time I've seen someone put a cost number on getting that wrong.

Also worth your time:

  • ​Anthropic on effective context engineering. The scarce resource in a long-running agent is attention, not tokens. Let the agent write its own notes, reset, and read them back. I like this one because it treats memory as a design discipline rather than a bigger context window, which is the argument I've been making for a while.
  • ​Lilian Weng, Harness Engineering for Self-Improvement. The biggest gains now come from the scaffolding around the model, not new weights. It's the clearest articulation yet of a progression I've been watching: weights, then context, then harness. If you're building agents today, that's where your leverage sits.
  • ​LlamaIndex on why dumber agents need better constraints. Well-shaped tools and guardrails beat raw capability in production. I keep recommending it because it makes reliability something you can fix this quarter instead of something you wait on a lab for.

Papers

Learning resources


The thing I keep coming back to: the agents that win won't be the ones with the biggest model, but the ones that remember well and improve quietly between sessions. Harness, memory, and evaluation are the unsexy trio doing the real work.

Reply and tell me what you're building with agent memory. I read every one and I'll feature the best answers next week.

Richmond from LLMCamp

600 1st Ave, Ste 330 PMB 92768, Seattle, WA 98104-2246
​Unsubscribe · Preferences​

AI With Me