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
- Label current session from WebChat.
- Click New Session (UI) or send
/new.
- Session label disappears.
- Session list still shows one key (
agent:main:main), often perceived as main:main:main in UI.
- Old messages are not listed as separate sessions in UI.
- 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
- Is
/new intended to keep one key (agent:main:main) and only rotate sessionId?
- Should
/new preserve existing label like sessions.reset does?
- Is the UI expected to expose reset archives/history, or is single-row behavior by design?
- 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).
OpenClaw WebChat
/newBehavior vs Session Label/History IndexingSummary
On a stock OpenClaw install (
2026.2.21-2), WebChat "New Session" (or sending/new) keeps only one session row (agent:main:main) insessions.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
2026.2.21-2openclaw-gateway.service(user unit, enabled+active)/home/jarvis/.nvm/versions/node/v24.13.0/bin/node .../openclaw/dist/index.js gateway --port 16372Observed Behavior
/new.agent:main:main), often perceived asmain:main:mainin UI.*.jsonl.reset.*) under agent session dirs.Expected Behavior (user expectation)
/newpreserves label in the active entry when rotatingsessionId, orHard Evidence
1) Live gateway
sessions.listreturns single indexed sessionObserved response:
count: 1sessions[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:39.jsonl:11.jsonl.reset.*:233) Main session index has only one key and empty label
From
~/.openclaw/agents/main/sessions/sessions.json:main_keys=1agent:main:mainmain_label=(empty)4) UI New Session action sends
/newdist/control-ui/assets/index-Cx1_w3YP.js:7665contains:onNewSession:()=>e.handleSendChat("/new",{restoreDraft:!0})5) Session key canonicalization collapses direct chats to main bucket
dist/sessions-BpJAqQ8e.js:590-603agent:main:<mainKey>(default main key)6)
sessions.listreads session store (index), not transcript archive inventorydist/gateway-cli-Cq5z-VKf.js:7173-7183sessions.list->loadCombinedSessionStoreForGateway(cfg)->listSessionsFromStore(...)7)
sessions.resetpath preserves labeldist/gateway-cli-Cq5z-VKf.js:7337-7350label: entry?.label8) Chat
/newflow rebuilds session entry and archives prior transcriptdist/reply-B2UJINPw.js:71090-71115labeldist/reply-B2UJINPw.js:71183-71188"reset"Potential Root Cause
There appears to be an inconsistency between:
sessions.reset) that preserves label, and/newpath (used by WebChat New Session) that rebuilds entry and may not preserve label.Combined with store-based listing, this yields:
Questions for Maintainers
/newintended to keep one key (agent:main:main) and only rotatesessionId?/newpreserve existinglabellikesessions.resetdoes?Local Integrity Notes
openclaw update --yes --tag 2026.2.21-2).