Skip to content

[Bug] Control UI (webchat) creates new session on WebSocket reconnection instead of resuming #68162

Description

@zhong18804784882

Bug: Control UI (webchat) creates new session on every WebSocket reconnection

Environment:

  • OpenClaw: v2026.4.15
  • OS: Windows 10
  • Channel: webchat (Control UI)
  • Model: MiniMax-M2.7

Description:
When using the Control UI (webchat), a new session is created on every WebSocket disconnection/reconnection instead of resuming the previous session. This causes context loss and a poor user experience.

Expected behavior:
When the webchat WebSocket reconnects (after network hiccup, browser tab minimize/restore, or page refresh), the existing session should be resumed, not replaced with a new one.

Actual behavior:

  1. User is in an active session
  2. WebSocket disconnects (even briefly)
  3. Gateway creates a brand new session on reconnection
  4. Previous session context is lost from the user's perspective

Session timeline observed today (2026-04-17):

22:07  d6b5f8ec (3MB session) ← compacted
22:17  81b0ede9 (34KB)
22:12  49fff9a4 (1MB) ← user said "why did it refresh again"
22:24-26  49fff9a4 checkpoint files created (4 compactions)
22:26  49fff9a4 last activity
22:34  0ed63899 (current) ← new session created due to reconnect

Investigation findings:

  • parentForkMaxTokens: 0 is correctly set (no auto-fork on compaction threshold)
  • Compaction works correctly and creates checkpoint files
  • The Gateway process stays stable — sessions are preserved server-side
  • The issue is specifically: webchat frontend reconnects → Gateway creates new session instead of resuming
  • This appears to be a webchat session recovery logic bug in the EC() function on the frontend

Workaround:
Keep the Control UI tab open without refreshing/minimizing. But this is not practical for normal use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions