openclaw - 💡(How to fix) Fix Control UI auth retry loop + blocking chat.history causes Slack Socket Mode disconnects [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#72139Fetched 2026-04-27 05:34:22
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

Control UI with a stale/expired gateway auth token retries WebSocket connection every ~16 seconds indefinitely, instead of stopping and prompting the user to re-enter the token. Combined with chat.history appearing to block the Node.js event loop for ~12 seconds, this causes Slack Socket Mode pong timeouts and repeated socket disconnects.

Error Message

[WARN] pong not received before 5000ms! ← 13:06:24.898

Root Cause

Control UI with a stale/expired gateway auth token retries WebSocket connection every ~16 seconds indefinitely, instead of stopping and prompting the user to re-enter the token. Combined with chat.history appearing to block the Node.js event loop for ~12 seconds, this causes Slack Socket Mode pong timeouts and repeated socket disconnects.

Fix Action

Workaround

Closing the Control UI browser tabs immediately resolved the issue — Slack response time dropped from ~57 seconds to ~7 seconds.

Code Example

[ws] chat.history completed (12667ms)13:06:24.895
[WARN] pong not received before 5000ms!13:06:24.898
RAW_BUFFERClick to expand / collapse

Summary

Control UI with a stale/expired gateway auth token retries WebSocket connection every ~16 seconds indefinitely, instead of stopping and prompting the user to re-enter the token. Combined with chat.history appearing to block the Node.js event loop for ~12 seconds, this causes Slack Socket Mode pong timeouts and repeated socket disconnects.

Steps to Reproduce

  1. Have Slack channel running via Socket Mode
  2. Open Control UI in a browser tab
  3. Gateway restarts (or token rotates for any reason)
  4. Control UI now has a stale token

Observed Behavior

  • Control UI retries WebSocket auth every ~16 seconds with token_mismatch — never stops, never prompts user
  • chat.history WebSocket handler takes ~12-13 seconds to complete
  • During that ~12s window, the Node.js event loop appears blocked — Slack WebSocket pong responses cannot be sent
  • Slack SDK fires pong timeout (5000ms) → socket disconnect → reconnect takes 35-40 seconds
  • Any Slack messages sent during disconnect windows are delayed until reconnection
  • Net effect: simple Slack DMs take 50-110+ seconds to get a response, even though model latency is ~3 seconds

Evidence Pattern

On every gateway restart, chat.history completion and Slack pong timeout occur within 1-3ms of each other:

[ws] chat.history completed (12667ms)    ← 13:06:24.895
[WARN] pong not received before 5000ms!  ← 13:06:24.898

This pattern was consistent across 4 consecutive restarts.

Expected Behavior

  1. Control UI should stop retrying on auth failure and display a clear "token expired — please re-enter" message instead of silently looping every 16 seconds
  2. chat.history should not block the event loop — 12+ seconds of synchronous work on what should be a local operation is excessive and starves other WebSocket connections (Slack, Telegram) of pong responses
  3. A UI authentication issue should never be able to degrade channel connectivity

Workaround

Closing the Control UI browser tabs immediately resolved the issue — Slack response time dropped from ~57 seconds to ~7 seconds.

Environment

  • OpenClaw v2026.4.24
  • Node.js v24.13.1
  • Slack channel in Socket Mode
  • Linux (Fedora)

extent analysis

TL;DR

Implement a retry limit for WebSocket authentication in the Control UI to prevent indefinite retries with a stale token.

Guidance

  • Investigate the authentication retry mechanism in the Control UI to determine why it does not stop retrying after a certain number of attempts.
  • Review the chat.history WebSocket handler to identify the cause of the 12-second blockage of the Node.js event loop and consider optimizing or asynchronous handling.
  • Consider implementing a mechanism to detect token expiration and prompt the user to re-enter the token instead of silently retrying.
  • Verify that the Slack SDK's pong timeout is properly configured and adjust as needed to accommodate the expected response time.

Example

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

Notes

The provided workaround of closing the Control UI browser tabs suggests that the issue is related to the client-side implementation. However, the root cause may involve a combination of factors, including the authentication mechanism, the chat.history handler, and the Slack SDK configuration.

Recommendation

Apply a workaround by implementing a retry limit for WebSocket authentication in the Control UI to prevent indefinite retries and investigate the chat.history handler optimization to prevent event loop blockage. This approach addresses the immediate issue and allows for further investigation into the underlying causes.

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 Control UI auth retry loop + blocking chat.history causes Slack Socket Mode disconnects [1 comments, 2 participants]