Skip to content

[Feature]: Memory flush on /new and /reset (pre-reset memory save) #8185

Description

@NullSense

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions