Stale tool results
What it looks like
An agent checks stock, a balance or a ticket status. Ten turns later it acts on that number again, but the real value has changed. It tells the user an item is in stock when it sold out. It closes a ticket someone already reopened. Nothing in the logs looks like an error.
Why it happens
When an agent calls a tool, the result is pasted into the conversation as text. From then on it is just part of the history. The model has no built-in sense of time. It cannot tell a result from two seconds ago from one fetched yesterday, unless you tell it.
Long agent runs make this worse. The history fills with old results, and the model may pick the first matching one instead of the latest. Old results also take up tokens on every later call, so stale data costs you money as well as accuracy.
How to spot it
- The agent quotes a value that does not match the live system.
- The same tool appears several times in the history with different answers.
- Bugs show up only in long sessions, or after a user leaves and comes back.
- Input tokens per call keep growing, mostly from tool output.
Fix checklist
- Stamp each tool result with the time it was fetched, in the text the model sees.
- When you fetch a fresh result, replace or remove the older one in the history.
- Set a max age for data that matters (money, stock, status) and re-fetch before acting on it.
- Keep tool output small: return the fields the model needs, not the whole record.
- Before any write action, have your code re-check the value, not the model.
Lasting fix
- Running several agents? COSMOS Clusters (in development): run several coding agents at once and still know what each one did.
- XTalk (built, stream transport working): let AI agents in different tools leave each other messages.
Related on Solaro sites
- DailyScar : read the story “A Two-Hundred for Stale Bytes” (a stale deploy, a close cousin of a stale tool result).
Next
Stale results also inflate token use. See Trim history without losing the goal and Budget surprises.