77.8% of Agent Runs Carry Stale File Views — Lessons From Building a Context-Refresh Layer
jabulari · reddit · 2026-09-28
After months on one agent-harness problem — tool results are snapshots but conversations treat them as permanent truth — the author measured 67k OpenHands trajectories and found 77.8% of runs carried at least one stale file view. He built a sidecar engine (freshctx, MIT, following the CORVUS paper) that rewrites outgoing requests: old reads become markers, current code moves to the end. Transferable lessons: rewrite only the sent copy; label every number shown to the model (a byte count misread as a line number caused loops); leave pointers when moving content; dynamic content at the end keeps cache prefixes stable but bills full price — removing stale views saved almost nothing; fail closed on mid-flight file changes; and byte-exact freshness (100% across 26k replays) didn't improve task outcomes when the model can re-read. A short script to measure staleness in your own transcripts may be the most useful takeaway.
More from coding & agent
- TypeSafe AI's Jev returns confidence-scored decisions, not text: a16z sits down with Diogo Almeida — a16z · 2026-09-28
- Codex app and remote get QOL updates: longest threads load in under 1 second — SIGKITTEN · 2026-09-28
- A 24-line Python agent that pulls and ranks weekly arXiv papers in 10s — omarsar0 · 2026-09-28
- Zhipu gives all GLM Coding Plan users weekly and 5-hour reset cards — Zai_org · 2026-09-28
- Motif: an MCP design library that lets coding agents consult design guidance while they build UI — Able_Bus_5988 · 2026-09-28
- Forge tracks how AI agents discover and buy your x402 APIs — kleffew94 · 2026-09-28