Skip to content

WebChat /new drops label and hides reset history despite transcripts on disk #23755

@ThunderStormer

Description

@ThunderStormer

OpenClaw WebChat /new Behavior vs Session Label/History Indexing

Summary

On a stock OpenClaw install (2026.2.21-2), WebChat "New Session" (or sending /new) keeps only one session row (agent:main:main) in sessions.list, archives prior transcript files to .jsonl.reset.*, and appears to drop user label metadata from the active session entry.

This makes chat history appear "lost" in UI, even though transcript files are present on disk.

Environment

  • OS: Ubuntu server
  • OpenClaw: 2026.2.21-2
  • Gateway service: openclaw-gateway.service (user unit, enabled+active)
  • Gateway exec path: /home/jarvis/.nvm/versions/node/v24.13.0/bin/node .../openclaw/dist/index.js gateway --port 16372

Observed Behavior

  1. Label current session from WebChat.
  2. Click New Session (UI) or send /new.
  3. Session label disappears.
  4. Session list still shows one key (agent:main:main), often perceived as main:main:main in UI.
  5. Old messages are not listed as separate sessions in UI.
  6. On disk, many archived transcript files exist (*.jsonl.reset.*) under agent session dirs.

Expected Behavior (user expectation)

  • Either:
    • /new preserves label in the active entry when rotating sessionId, or
    • UI/session model clearly surfaces archived resets/history as prior sessions.
  • Avoid apparent "history loss" when transcripts are still present on disk.

Hard Evidence

1) Live gateway sessions.list returns single indexed session

Observed response:

  • count: 1
  • sessions[0].key: "agent:main:main"
  • sessions[0].sessionId: "bd4b2023-7648-406e-8e22-1bbda20c2dce"

2) Session files exist, including many reset archives

Under ~/.openclaw/agents/main/sessions:

  • total files: 39
  • live .jsonl: 11
  • reset archives .jsonl.reset.*: 23

3) Main session index has only one key and empty label

From ~/.openclaw/agents/main/sessions/sessions.json:

  • main_keys=1
  • key: agent:main:main
  • main_label= (empty)

4) UI New Session action sends /new

  • dist/control-ui/assets/index-Cx1_w3YP.js:7665 contains:
    • onNewSession:()=>e.handleSendChat("/new",{restoreDraft:!0})

5) Session key canonicalization collapses direct chats to main bucket

  • dist/sessions-BpJAqQ8e.js:590-603
    • comment says non-group direct chats collapse to canonical direct bucket
    • canonical key resolves to agent:main:<mainKey> (default main key)

6) sessions.list reads session store (index), not transcript archive inventory

  • dist/gateway-cli-Cq5z-VKf.js:7173-7183
    • sessions.list -> loadCombinedSessionStoreForGateway(cfg) -> listSessionsFromStore(...)

7) sessions.reset path preserves label

  • dist/gateway-cli-Cq5z-VKf.js:7337-7350
    • reset entry explicitly includes label: entry?.label

8) Chat /new flow rebuilds session entry and archives prior transcript

  • dist/reply-B2UJINPw.js:71090-71115
    • session entry reconstructed with many fields but no explicit label
  • dist/reply-B2UJINPw.js:71183-71188
    • previous transcript archived with reason "reset"

Potential Root Cause

There appears to be an inconsistency between:

  • gateway RPC reset path (sessions.reset) that preserves label, and
  • chat command /new path (used by WebChat New Session) that rebuilds entry and may not preserve label.

Combined with store-based listing, this yields:

  • one visible session key,
  • archived files on disk,
  • no visible historical sessions in the UI list,
  • perceived label loss.

Questions for Maintainers

  1. Is /new intended to keep one key (agent:main:main) and only rotate sessionId?
  2. Should /new preserve existing label like sessions.reset does?
  3. Is the UI expected to expose reset archives/history, or is single-row behavior by design?
  4. If by design, can docs/UI messaging clarify this to avoid apparent data-loss confusion?

Local Integrity Notes

  • Install was restored to stock via official updater (openclaw update --yes --tag 2026.2.21-2).
  • No local code patch retained in installed dist after restore.
  • Chat transcript files are present on disk (history not physically lost).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions