openclaw - 💡(How to fix) Fix [Bug]:TUI enters infinite reconnect loop on WebSocket close (code 1006) [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#73666Fetched 2026-04-29 06:16:40
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1

TUI repeatedly reconnects on WebSocket close (code 1006) without stopping or showing the underlying error.

Error Message

TUI repeatedly reconnects on WebSocket close (code 1006) without stopping or showing the underlying error. TUI should stop retrying after connection failure or show a clear error message. Consequence: Terminal flooded, underlying error not visible

Root Cause

TUI repeatedly reconnects on WebSocket close (code 1006) without stopping or showing the underlying error.

Code Example

WebSocket closed (code 1006)
reconnecting...
WebSocket closed (code 1006)
reconnecting...
(repeats indefinitely)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

TUI repeatedly reconnects on WebSocket close (code 1006) without stopping or showing the underlying error.

Steps to reproduce

  1. Start gateway: openclaw gateway

  2. Use a client that cannot authenticate (e.g. not initialized or incompatible)

  3. Start TUI: openclaw tui

  4. Observe repeated reconnect attempts

Expected behavior

TUI should stop retrying after connection failure or show a clear error message.

Actual behavior

TUI continuously reconnects and prints:

WebSocket closed (code 1006) reconnecting...

This repeats indefinitely without exit.

OpenClaw version

2026.4.24

Operating system

macOS 15.4

Install method

npm global

Model

NOT_RELEVANT

Provider / routing chain

NOT_RELEVANT

Additional provider/model setup details

NOT_RELEVANT

Logs, screenshots, and evidence

WebSocket closed (code 1006)
reconnecting...
WebSocket closed (code 1006)
reconnecting...
(repeats indefinitely)

Impact and severity

Affected: TUI users encountering connection failure Severity: High (CLI unusable) Frequency: Always (observed repeatedly) Consequence: Terminal flooded, underlying error not visible

Additional information

Process must be terminated manually (Ctrl + C).

Occurs consistently when connection fails (e.g. authentication issues).

extent analysis

TL;DR

The TUI should be modified to handle WebSocket close events with code 1006 by stopping retry attempts or displaying the underlying error message.

Guidance

  • Investigate the WebSocket connection handling in the TUI code to identify why it's not stopping or showing the error after a close event with code 1006.
  • Consider implementing a retry limit or a backoff strategy to prevent indefinite reconnect attempts.
  • Review the error handling mechanism to ensure that the underlying error is properly propagated and displayed to the user.
  • Check if there are any existing configuration options or environment variables that can be used to control the TUI's reconnect behavior.

Example

No code example is provided due to the lack of specific code context in the issue.

Notes

The issue seems to be specific to the TUI's handling of WebSocket close events, and the solution may involve modifying the TUI code to properly handle these events.

Recommendation

Apply workaround: Modify the TUI code to handle WebSocket close events with code 1006 by stopping retry attempts or displaying the underlying error message, as this is a high-severity issue that makes the CLI unusable.

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

TUI should stop retrying after connection failure or show a clear error message.

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 enters infinite reconnect loop on WebSocket close (code 1006) [1 comments, 2 participants]