Description
A session was silently abandoned after compaction, causing complete loss of conversation context. The user's agent lost all memory of the conversation and could not recall anything discussed earlier.
Steps to Reproduce
- Let a session grow large enough to trigger \model_context_window_exceeded\ from the provider
- Safeguard compaction kicks in — two consecutive compaction events fire within 1 second
- The session file receives no further writes after compaction
- On the next incoming message, OpenClaw creates a brand new empty session instead of resuming the compacted one
- Result: the agent starts with zero conversation context — complete amnesia
Expected Behavior
After compaction, the session should resume with the compacted summary. The agent should remember what was discussed before compaction.
What Actually Happened
- Old session file exists on disk (not reset, not deleted — just orphaned)
- New session is created from scratch
- Agent has no recollection of any prior conversation
- Only way to recover context is by reading the orphaned session file manually
Possible Root Causes
- Double-compaction race condition? Two compaction events fired within 1 second — could this corrupt the session state?
- Error recovery failure? \model_context_window_exceeded\ → compaction → but the error may leave the session in an unrecoverable state
- Session routing logic may have a fallback path that creates a new session when it can't load the compacted state
Environment
- OpenClaw 2026.4.1 (da64a97)
- Provider: zai (GLM-5-turbo, OpenAI-compatible API)
- compaction.mode: safeguard
- session.reset: not configured (default daily)
Description
A session was silently abandoned after compaction, causing complete loss of conversation context. The user's agent lost all memory of the conversation and could not recall anything discussed earlier.
Steps to Reproduce
Expected Behavior
After compaction, the session should resume with the compacted summary. The agent should remember what was discussed before compaction.
What Actually Happened
Possible Root Causes
Environment