Agents and beyond
Coding sessions: where the output goes
When an agent runs code, the harness executes it and returns the program's output (stdout and stderr) as a tool result appended to the context, like any other turn.
Two caveats that explain "it forgot the error"
| Caveat | What happens | What good agents do |
|---|---|---|
| Truncation | Large outputs are cut (head and tail of a log, the first N kilobytes of a file) before they enter the context. The model may not have seen the whole thing. | Redirect big output to a file and search it. |
| Compaction | Tool results are the first thing summarized or dropped when the window fills. | Write the error, the fix, and the test result to a file or a note. |
Try it (needs a coding agent, if your role permits)
Give an agent a small data-cleaning task with a deliberately failing step. Watch the error come back as a tool result. Let the context grow, force a compaction, then ask the agent about the earlier error. Note what survived.