Summary
When a user triggers /new or /reset, the session is discarded without giving the agent a chance to save important context to memory files. The existing pre-compaction memory flush only triggers on auto-compaction, not on manual resets.
Problem
- User says
/new mid-conversation → important context is lost
- The agent has no opportunity to write durable notes before the session is wiped
- Pre-compaction flush exists and works well, but doesn't cover manual resets
Proposed Solution
Add an optional memory flush turn before /new and /reset take effect, similar to the existing compaction.memoryFlush mechanism:
{
session: {
resetFlush: {
enabled: true,
prompt: "Session is being reset. Save any important context to memory files now. Reply with NO_REPLY.",
systemPrompt: "User triggered /new or /reset. Write durable notes before the session is cleared."
}
}
}
Alternatively, a simpler approach: add a /save command that triggers the memory flush prompt without resetting, so users can /save then /new.
Current Workaround
Users can manually ask the agent to "save context" before running /new, but this is easy to forget and not automated.
Environment
- OpenClaw 2026.2.1
- Using
compaction.memoryFlush successfully for auto-compaction
Summary
When a user triggers
/newor/reset, the session is discarded without giving the agent a chance to save important context to memory files. The existing pre-compaction memory flush only triggers on auto-compaction, not on manual resets.Problem
/newmid-conversation → important context is lostProposed Solution
Add an optional memory flush turn before
/newand/resettake effect, similar to the existingcompaction.memoryFlushmechanism:Alternatively, a simpler approach: add a
/savecommand that triggers the memory flush prompt without resetting, so users can/savethen/new.Current Workaround
Users can manually ask the agent to "save context" before running
/new, but this is easy to forget and not automated.Environment
compaction.memoryFlushsuccessfully for auto-compaction