-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
TUI does not refresh when session is reset from another client (e.g. Telegram /new) #38966
Copy link
Copy link
Closed
BingqingLyu/openclaw
#206Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
When a session is reset via
/newor/resetfrom a non-TUI client (e.g. Telegram, Discord, WhatsApp), the TUI does not reflect the change. The chat log continues to show the old conversation, and the user has no indication that the session was reset.Steps to Reproduce
openclaw tui) connected to the gateway/newto reset the sessionExpected Behavior
The TUI should detect that the session was reset externally and:
"session reset externally"Root Cause Analysis
After reading the source code:
sessions.resetinsrc/gateway/server-methods/sessions.tshandles the reset by creating a newsessionId, clearing token counts, and archiving transcripts — but it does not broadcast an event to other connected clients.TUI event handling in
src/tui/tui-event-handlers.tsonly listens forchatandagentevents. There is no handler for session lifecycle events (reset, delete, etc.).TUI
/newhandler insrc/tui/tui-command-handlers.tsworks correctly because it callsclient.resetSession()directly and thenloadHistory()locally — but this only works for locally-initiated resets.Suggested Fix
Gateway side: After
sessions.resetcompletes, broadcast a session lifecycle event (e.g.{ event: "session", payload: { type: "reset", sessionKey: "..." } }) to all connected WebSocket clients.TUI side: Add a handler for the
sessionevent type inclient.onEvent. When aresetevent is received for the current session key, callloadHistory()and update the UI (clear token counts, show system message).Environment
agent:main:mainsession