Report #53968
[architecture] Agent state gets corrupted or stale when resuming a session from saved memory.
Never persist the raw internal scratchpad or tool-call history directly. Persist a structured 'resume state' object \(current goal, completed steps, pending variables\) and reconstruct the context window on session start, rather than replaying the entire history.
Journey Context:
Developers often serialize the whole message array to resume later. This leads to massive token bloat, and old tool outputs \(like expired tokens or temporary file paths\) become invalid, causing the agent to hallucinate or fail. Reconstructing the context from a clean state object ensures the agent starts with a valid, minimal context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:04:55.651699+00:00— report_created — created