openclaw - 💡(How to fix) Fix [Bug]: sessions_send intermittent timeout and gateway closed failures despite Gateway running normally [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#73861Fetched 2026-04-29 06:14:06
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

Error Message

Error Symptoms

Root Cause

The most likely cause is Gateway internal session routing table becoming stale:

  • The Gateway correctly listens for connections and passes health checks
  • But the internal session routing/session mapping becomes stale after:
    • Long running time without restart
    • Frequent session creation/destruction
    • Network fluctuations causing state desync

Temporary resolution can be achieved by restarting the Gateway, which:

  1. Clears the stale routing table
  2. Rebuilds WebSocket connection pool
  3. Resets message queue
  4. Re-registers all sessions

Code Example

sessions_send -> status: "timeout"
sessions_send -> "gateway closed (1000 normal closure)"
RAW_BUFFERClick to expand / collapse

Describe the bug

The sessions_send mechanism experiences intermittent failures, manifesting as:

  • Persistent timeouts when sending messages to other agent sessions
  • "gateway closed (1000 normal closure)" errors
  • Connection drops mid-transmission

The Gateway itself reports healthy status (listening on port, RPC probe ok), but internal session message routing fails.

Error Symptoms

sessions_send -> status: "timeout"
sessions_send -> "gateway closed (1000 normal closure)"

In some cases, the failure persists through 20+ consecutive retry attempts over several minutes.

Diagnostic Observations

CheckResult
Gateway serviceOK - Normal (listening on 127.0.0.1:port)
RPC probeOK
sessions_send to other agentsFAIL - Timeout / gateway closed
Channel direct messages (e.g., Feishu group @mention)OK - Normal

Environment

  • OS: Windows_NT 10.0.20348 (x64) / Windows Server 2019
  • Node.js: v24.14.1
  • OpenClaw: v2026.4.26
  • Deployment: Multi-agent local deployment (7+ agents)

Root Cause Analysis

The most likely cause is Gateway internal session routing table becoming stale:

  • The Gateway correctly listens for connections and passes health checks
  • But the internal session routing/session mapping becomes stale after:
    • Long running time without restart
    • Frequent session creation/destruction
    • Network fluctuations causing state desync

Temporary resolution can be achieved by restarting the Gateway, which:

  1. Clears the stale routing table
  2. Rebuilds WebSocket connection pool
  3. Resets message queue
  4. Re-registers all sessions

Impact

  • Cross-agent communication via sessions_send becomes unreliable
  • Multi-agent coordination workflows are disrupted
  • Requires manual Gateway restart to restore functionality
  • Affects production environments running multi-agent setups

extent analysis

TL;DR

Restarting the Gateway service may temporarily resolve the issue by clearing the stale session routing table and rebuilding the WebSocket connection pool.

Guidance

  • Verify the Gateway's internal session routing table is becoming stale by checking the frequency of session creation and destruction, as well as network fluctuations.
  • Consider implementing a periodic restart of the Gateway service to prevent the routing table from becoming stale.
  • Investigate the root cause of the stale routing table, such as long running time without restart, frequent session creation/destruction, or network fluctuations.
  • Monitor the Gateway's performance and adjust the restart frequency accordingly to minimize downtime.

Example

No code snippet is provided as it is not explicitly mentioned in the issue.

Notes

The provided solution is temporary and may not be suitable for production environments. A more permanent solution would require identifying and addressing the root cause of the stale routing table.

Recommendation

Apply workaround: Restart the Gateway service periodically to clear the stale session routing table and rebuild the WebSocket connection pool, as this is a temporary resolution that can restore functionality until a more permanent solution is found.

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]: sessions_send intermittent timeout and gateway closed failures despite Gateway running normally [1 comments, 2 participants]