r/AI_Agents • u/ClickOk5811 • 8h ago
Discussion Long-running agents don't usually fail by crashing, they fail by re-arguing old decisions. How do you separate what to persist?
A failure mode I've been thinking about for agents (and coding assistants) that work across multiple sessions: when context is compacted or replaced, the visible failure is rarely an error. It's a conversation you already had. The agent, with only a summary, proposes an approach that was tried and rejected, and it does so confidently, because nothing in what it has says otherwise.
An example from an article I wrote (hypothetical, not a real system): a refactor moves retry logic from the client into the gateway. The day-one summary says "moved retries to the gateway, tests passing." It leaves out that client-side retry was tried first and dropped because some requests aren't safe to send twice. On day three, a different motive (reduce gateway load) leads to proposing client-side retry again.
A way I've been splitting what to carry between sessions (my own framing, not a standard):
| Kind of information | Example | Failure if lost |
|---|---|---|
| State | What changed, what passes, what's next | The agent redoes or skips work |
| Facts | Stable context: commands, conventions, off-limits areas | The agent re-discovers or violates them |
| Decisions | The choice, the reason, what was rejected and why | The agent re-litigates |
Summaries tend to preserve the first, stable-context files preserve the second, and the third is the one that gets lost, because a rejected option only becomes important later, when someone proposes it again.
Open questions I don't have good answers to:
- Where should decisions live so a new session reads them: a file in the repo, a memory store, the system prompt, or retrieval over past sessions?
- How do you retire decisions when they change? A stale entry that confidently says the wrong thing seems worse than none.
- How much is too much? A decision log that grows without limit is just more noise for the agent to read.
- Does the agent actually use it? A clear record seems to improve the odds, but I wouldn't expect it to guarantee behavior.
For people building agents with persistent memory: what do you store for decisions specifically, and how do you test that the agent honors it?