Skip to content

Feature request: session-scoped reset / forget for chat and group contexts #50790

Description

@1sexywoo8

Summary

OpenClaw currently appears to lack a first-class way to reset or forget a specific session context without affecting the broader runtime.

In practice, when a single chat or group session becomes polluted, stale, or behaviorally stuck, the available options are currently awkward:

  • do nothing and wait for new context to gradually dominate
  • restart broader runtime state
  • manually remove session files / index entries at the storage layer

The last option is often the narrowest and most effective in practice, but it is also low-level, unofficial, and easy to get wrong.

What is missing is a product-level notion of:

  • reset this session
  • forget this chat/group session
  • compact this session to empty
  • detach this session’s memory binding without restarting unrelated sessions

The actual problem

The user need here is not “restart the app” or even “restart the agent.”

The user need is:

release or reset the memory/context binding for one specific session key / chat scope

That is a much smaller unit than process restart, and it should ideally be handled as a first-class session operation rather than an indirect file-editing workaround.

Examples of situations where this matters:

  • one Telegram group session gets behaviorally confused
  • one thread accumulates too much stale routing or persona residue
  • a test room needs a clean context without touching other active chats
  • an operator wants to recover from one bad session state without broader disruption

Current workaround

Today, the most targeted workaround seems to be manual deletion/removal of the specific session file and related index entry.

Why people may do this:

  • it is narrower than restarting the gateway
  • it avoids disturbing unrelated sessions
  • it more closely matches the real target of the operation: the session record itself

But this has several problems:

  • it is not an official supported workflow
  • it requires storage-level knowledge
  • it is easy to remove the wrong thing
  • it is not auditable from product UX
  • it is hard to expose safely to non-technical operators

Why a first-class feature would be better

A session-scoped reset/forget operation would:

  • reduce the need for direct file manipulation
  • reduce blast radius compared with restart-based recovery
  • make operator intent explicit
  • allow safer confirmation flows
  • make future UI/CLI/admin tooling much cleaner
  • better match how users actually think about the problem

This is especially important in multi-chat / multi-group / multi-agent environments, where “just restart” is often too blunt.


Proposed feature

Add a supported session-level operation for one or more of the following actions:

  1. Reset session

    • clears the active conversational/session state for a specific session key
    • next interaction starts fresh in that session scope
  2. Forget session

    • removes the current session binding and derived transient context
    • intended for recovery from polluted or stale behavior
  3. Compact-to-empty

    • preserves the session identity but truncates the active remembered context to an empty baseline

Depending on the internal architecture, these may map to the same primitive or different modes.


Possible surfaces

CLI

Examples:

openclaw sessions reset --session-key <key>
openclaw sessions forget --session-key <key>
openclaw sessions compact --session-key <key> --to-empty

Admin / internal API

Examples:

  • POST /sessions/:key/reset
  • POST /sessions/:key/forget
  • POST /sessions/:key/compact?mode=empty

UI / operator tooling

For example:

  • “Reset this session”
  • “Forget current context”
  • “Clear this group/thread context only”

with confirmation and clear scope preview


Safety / UX expectations

A good implementation should make scope extremely explicit.

Suggested safeguards:

  • show the exact target session key / chat scope before execution
  • warn that this affects only the targeted session, not the full runtime
  • require confirmation for destructive reset/forget actions
  • ideally provide a dry-run / inspect mode first
  • optionally snapshot or log the prior session state before mutation
  • make post-action behavior predictable (“next message starts a fresh session context”)

Expected behavior

At minimum, after a successful session reset/forget:

  • unrelated chats/sessions remain untouched
  • the targeted session no longer carries its previous active context
  • subsequent messages in that session behave like a fresh context start
  • the action is visible in logs/audit trail

Non-goals

This request is not asking for:

  • full gateway restart
  • global memory wipe
  • cross-session deletion by default
  • long-term memory deletion (MEMORY.md, curated memory, etc.) unless explicitly requested as a separate feature

This is specifically about session-scoped conversational/runtime context, not all persistent memory everywhere.


Why this matters conceptually

From a first-principles perspective:

  • the problem is not process health
  • the problem is not agent identity
  • the problem is session binding

So the smallest correct control surface should be the session itself.

That is why storage-level deletion is often the most direct workaround today — but it should not remain the operator-facing solution.


Suggested priority

This feels like a worthwhile operational feature for any deployment with:

  • multiple concurrent chats
  • group/thread-heavy workflows
  • experimentation with agent routing/persona
  • debugging of context-related behavior regressions

Even a minimal first version would be valuable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions