openclaw - 💡(How to fix) Fix Bug: TUI reconnect creates new session instead of resuming previous one, causing silent conversation reset [1 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#73546Fetched 2026-04-29 06:18:27
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

When the TUI client reconnects to the gateway (e.g., after a network interruption or terminal restart), it creates a brand new session instead of resuming the previous session. This silently resets the conversation context. The user's ongoing conversation history becomes invisible to the new session, even though the old session's transcript is preserved as a .reset file on disk.

This is particularly disruptive when a conversation has been going on for a while and the user expects continuity.

Root Cause

When the TUI client reconnects to the gateway (e.g., after a network interruption or terminal restart), it creates a brand new session instead of resuming the previous session. This silently resets the conversation context. The user's ongoing conversation history becomes invisible to the new session, even though the old session's transcript is preserved as a .reset file on disk.

This is particularly disruptive when a conversation has been going on for a while and the user expects continuity.

RAW_BUFFERClick to expand / collapse

Description

When the TUI client reconnects to the gateway (e.g., after a network interruption or terminal restart), it creates a brand new session instead of resuming the previous session. This silently resets the conversation context. The user's ongoing conversation history becomes invisible to the new session, even though the old session's transcript is preserved as a .reset file on disk.

This is particularly disruptive when a conversation has been going on for a while and the user expects continuity.

Steps to Reproduce

  1. Start a conversation in the TUI (openclaw tui)
  2. Chat for an extended period (the issue seems more likely with longer sessions)
  3. Disconnect the TUI (e.g., close terminal, network interruption, or Ctrl+C)
  4. Reconnect by running openclaw tui again
  5. Send a message

Expected Behavior

The TUI should resume the previous session, maintaining full conversation continuity. If a new session must be created for technical reasons, the old session's context should be carried over or at least the user should be explicitly warned that they're starting fresh.

Actual Behavior

The TUI creates a new session with a new session key (e.g., agent:main:tui-<new-uuid> instead of continuing under the previous key like agent:main:main). The old session is silently reset — its transcript is archived as <id>.jsonl.reset.<timestamp> but the new session has zero context from the previous conversation.

The user only notices something is wrong when the assistant can't recall anything discussed moments ago.

Environment

  • OpenClaw version: 2026.4.25 (aa36ee6)
  • OS: Linux 6.6.87 (WSL2)
  • Channel: TUI (webchat)

Additional Context

I observed this with two sessions being reset within ~14 minutes during a TUI reconnection:

  1. A cron run session (daily-journal-auto) was reset when a new cron run started — this is expected behavior.
  2. The main TUI conversation session was reset when the TUI reconnected — this is the problematic case. The session key changed from agent:main:main to agent:main:tui-<uuid>, creating a completely new session with no conversation history.

The old session's full transcript was preserved in a .reset file and could be recovered by manually reading the file, but the assistant in the new session had no way to access it through normal tools (sessions_history, memory_search, etc. don't expose reset session transcripts).

Suggested Fix

  1. When TUI reconnects, it should attempt to resume the most recent session under the same or equivalent session key, preserving conversation context.
  2. If a new session must be created, surface a clear warning to the user.
  3. Consider providing a /resume command or mechanism to carry over context from a recently reset session.

extent analysis

TL;DR

The TUI client should attempt to resume the most recent session under the same or equivalent session key when reconnecting to preserve conversation context.

Guidance

  • Review the session management logic in the TUI client to ensure it checks for and resumes existing sessions based on a unique identifier, such as a session key, upon reconnection.
  • Implement a mechanism to surface a clear warning to the user if a new session is created instead of resuming an existing one, to manage user expectations.
  • Consider adding a /resume command or similar functionality to allow users to manually resume a recently reset session and carry over its context.
  • Investigate the use of the .reset file and how its contents could be automatically integrated into a new session to preserve conversation history.

Example

No specific code example can be provided without access to the TUI client's source code, but the logic should involve checking for existing session identifiers and attempting to reconnect to the most recent session upon restart.

Notes

The exact implementation details may depend on the internal workings of the OpenClaw TUI client and its session management mechanisms, which are not fully described in the issue.

Recommendation

Apply a workaround by modifying the TUI client to attempt session resumption upon reconnection, as this directly addresses the reported issue of lost conversation context.

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…

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: TUI reconnect creates new session instead of resuming previous one, causing silent conversation reset [1 comments, 2 participants]