openclaw - 💡(How to fix) Fix [Bug]: Control UI/WebChat previous chat becomes inaccessible after New session [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59839Fetched 2026-04-08 02:39:54
View on GitHub
Comments
3
Participants
2
Timeline
10
Reactions
0
Timeline (top)
commented ×3mentioned ×3subscribed ×3labeled ×1

In Control UI/WebChat, clicking New session makes the previous chat inaccessible even though WebChat is documented as session-based and able to switch between sessions.

Root Cause

This is a session continuity / chat history UX bug. Users expect New session to preserve older chats, not make them effectively disappear.

Code Example

## Evidence

- In Control UI / WebChat, clicking **New session** caused the previous chat to become inaccessible from the UI.
- Local OpenClaw docs indicate WebChat is session-based and supports switching between sessions:
  - `docs/platforms/mac/webchat.md`
    - “The UI can switch between sessions.
    - Uses `chat.history`, `chat.send`, `chat.abort`, `chat.inject`
  - `docs/web/webchat`
    - “Uses the same sessions and routing rules as other channels.
    - “History is always fetched from the gateway”
- Local session investigation suggested that prior chat continuity was not behaving as expected in the session store / session resolution path.
- Potentially related existing issue:
  - `#29683` — raw vs canonical session-key mismatch causing apparent session loss

A screenshot of the UI state where the prior chat was no longer accessible can be attached here.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

In Control UI/WebChat, clicking New session makes the previous chat inaccessible even though WebChat is documented as session-based and able to switch between sessions.

Steps to reproduce

What is broken

In Control UI / WebChat, clicking New session makes the previous chat appear inaccessible from the UI.

Expected behavior

  • Clicking New session should create/select a new session
  • The previous chat should remain accessible
  • The UI/session switcher should still allow returning to the old chat

Actual behavior

  • After clicking New session, the previous chat is no longer visible/recoverable from the UI
  • It appears as if the prior conversation has been lost

Observed evidence

OpenClaw docs indicate that WebChat is session-based and supports switching between sessions:

  • docs/platforms/mac/webchat.md

    • WebChat defaults to the main session
    • “The UI can switch between sessions.”
    • Uses chat.history, chat.send, chat.abort, chat.inject
  • docs/web/webchat

    • “Uses the same sessions and routing rules as other channels.”
    • “History is always fetched from the gateway”

This suggests previous chats should remain accessible rather than disappearing after New session.

Related investigation

There may be a related session-key handling problem.

Relevant existing issue:

  • #29683 — initSessionState uses raw session key while read paths canonicalize

That issue describes a situation where session state is written under one key form and later read using another, which can make an existing transcript appear missing and cause a fresh session to be created.

I have not confirmed that this is the exact same root cause for the New session path, but it looks closely related.

Areas worth checking

  • Control UI / WebChat new-session flow
  • session switcher population logic
  • chat.history lookup path
  • initSessionState(...)
  • resolveSessionKey(...)
  • session-store read/write canonicalization

Why this matters

This is a session continuity / chat history UX bug. Users expect New session to preserve older chats, not make them effectively disappear.

Expected behavior

Clicking New session should start a new, empty chat without deleting, hiding, or orphaning previous chats. Older sessions should remain visible and reopenable from the session switcher/history UI, and their message history should still load normally via the gateway.

Actual behavior

Actual behavior

OpenClaw version

v2026.3.31

Operating system

MacOS Sequoia 15.7.5

Install method

mac app

Model

openai/gpt-5.4

Provider / routing chain

openclaw -> openai/gpt-5.4

Additional provider/model setup details

Tested in Control UI / WebChat. Effective model in the observed session was openai/gpt-5.4.

I have not verified whether any additional external proxy/router was involved in the request path, so no further routing assumptions are included here.

Logs, screenshots, and evidence

## Evidence

- In Control UI / WebChat, clicking **New session** caused the previous chat to become inaccessible from the UI.
- Local OpenClaw docs indicate WebChat is session-based and supports switching between sessions:
  - `docs/platforms/mac/webchat.md`
    - “The UI can switch between sessions.”
    - Uses `chat.history`, `chat.send`, `chat.abort`, `chat.inject`
  - `docs/web/webchat`
    - “Uses the same sessions and routing rules as other channels.”
    - “History is always fetched from the gateway”
- Local session investigation suggested that prior chat continuity was not behaving as expected in the session store / session resolution path.
- Potentially related existing issue:
  - `#29683` — raw vs canonical session-key mismatch causing apparent session loss

A screenshot of the UI state where the prior chat was no longer accessible can be attached here.

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The most likely fix for the issue where clicking "New session" in Control UI/WebChat makes the previous chat inaccessible is to resolve the session-key handling problem, potentially related to the existing issue #29683, which causes a mismatch between raw and canonical session keys.

Guidance

  • Investigate the initSessionState function to ensure it uses the canonicalized session key, as the existing issue #29683 suggests a problem with raw session key usage.
  • Verify the session switcher population logic to ensure it correctly handles and displays previous chat sessions.
  • Check the chat.history lookup path to confirm it fetches history from the gateway correctly, even after a new session is started.
  • Review the session-store read/write canonicalization to prevent session loss due to key mismatches.

Example

No specific code example can be provided without more context, but ensuring that initSessionState and other relevant functions use canonicalized session keys consistently is crucial.

Notes

The fix may involve updating the session-key handling to consistently use canonicalized keys, which could resolve the issue of previous chats becoming inaccessible after starting a new session. However, without direct access to the codebase, this remains a targeted guess based on the information provided.

Recommendation

Apply a workaround to ensure session-key consistency, such as modifying initSessionState to use canonicalized session keys, until a permanent fix can be implemented and verified. This approach is recommended because it directly addresses the likely root cause of the issue, as suggested by the related existing issue #29683.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Clicking New session should start a new, empty chat without deleting, hiding, or orphaning previous chats. Older sessions should remain visible and reopenable from the session switcher/history UI, and their message history should still load normally via the gateway.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Control UI/WebChat previous chat becomes inaccessible after New session [3 comments, 2 participants]