openclaw - 💡(How to fix) Fix P2P messages stuck with replies=0 after gateway restart [2 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#58953Fetched 2026-04-08 02:30:49
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×2cross-referenced ×1

After running openclaw gateway restart, the main session stops processing p2p (direct message) messages. Messages are received and dispatched by the gateway, but the agent generates zero replies (replies=0). The session only recovers when a group chat message triggers the agent.

Root Cause

After running openclaw gateway restart, the main session stops processing p2p (direct message) messages. Messages are received and dispatched by the gateway, but the agent generates zero replies (replies=0). The session only recovers when a group chat message triggers the agent.

Fix Action

Workaround

After every openclaw gateway restart, send a message in a group chat that mentions the bot. This "wakes up" the main session and processes all queued p2p messages.

Code Example

# After gateway restart, p2p messages arrive:
Apr 01 18:07:55 feishu[default]: dispatching to agent (session=agent:main:main)
Apr 01 18:07:55 feishu[default]: dispatch complete (replies=0, elapsed=448ms)

Apr 01 18:08:14 feishu[default]: dispatching to agent (session=agent:main:main)
Apr 01 18:08:14 feishu[default]: dispatch complete (replies=0, elapsed=581ms)

# After group chat @mention, everything works again:
Apr 01 18:23:51 feishu[default]: dispatching to agent (session=agent:main:main)
Apr 01 18:23:51 feishu[default]: dispatch complete (replies=0, elapsed=528ms)
# (group session processes, then p2p session starts responding)
RAW_BUFFERClick to expand / collapse

Issue: P2P messages stuck with replies=0 after gateway restart

Description

After running openclaw gateway restart, the main session stops processing p2p (direct message) messages. Messages are received and dispatched by the gateway, but the agent generates zero replies (replies=0). The session only recovers when a group chat message triggers the agent.

Environment

  • OpenClaw version: 2026.3.24 (cff6dc9)
  • OS: Ubuntu (Linux 6.8.0-55-generic)
  • Channel: Feishu (Lark)
  • Model: openrouter/xiaomi/mimo-v2-pro

Reproduction Steps

  1. Have an active p2p session with the bot (via Feishu DM)
  2. From the agent session, run openclaw gateway restart (e.g., to reload plugin config)
  3. Gateway restarts successfully
  4. Send a p2p message to the bot
  5. Observe: Gateway logs show dispatching to agent (session=agent:main:main) followed by dispatch complete (replies=0, elapsed=XXXms)
  6. The bot does NOT reply to the p2p message
  7. Now send a group chat message mentioning the bot
  8. Observe: The bot responds in the group AND the queued p2p messages suddenly get processed and replied to

Expected Behavior

After gateway restart, the main session should automatically resume processing queued p2p messages without requiring a group chat message as a "wake-up signal."

Actual Behavior

  • P2P messages are received by gateway ✅
  • P2P messages are dispatched to agent:main:main session ✅
  • Session processes messages but returns replies=0
  • Only recovers when a group message triggers the agent ❌

Relevant Logs

# After gateway restart, p2p messages arrive:
Apr 01 18:07:55 feishu[default]: dispatching to agent (session=agent:main:main)
Apr 01 18:07:55 feishu[default]: dispatch complete (replies=0, elapsed=448ms)

Apr 01 18:08:14 feishu[default]: dispatching to agent (session=agent:main:main)
Apr 01 18:08:14 feishu[default]: dispatch complete (replies=0, elapsed=581ms)

# After group chat @mention, everything works again:
Apr 01 18:23:51 feishu[default]: dispatching to agent (session=agent:main:main)
Apr 01 18:23:51 feishu[default]: dispatch complete (replies=0, elapsed=528ms)
# (group session processes, then p2p session starts responding)

Hypothesis

The gateway restart disconnects the main session's message consumption loop. New p2p messages are queued but the session's event loop doesn't resume processing them. A group chat interaction somehow flushes/wakes the main session's queue.

Workaround

After every openclaw gateway restart, send a message in a group chat that mentions the bot. This "wakes up" the main session and processes all queued p2p messages.

Impact

Users who frequently restart the gateway (e.g., to reload plugin configurations) will find their p2p conversations completely unresponsive until they happen to interact via group chat.

extent analysis

TL;DR

Restarting the agent:main:main session after the gateway restart may resolve the issue of p2p messages being stuck with zero replies.

Guidance

  • Investigate the session's event loop to determine why it doesn't resume processing p2p messages after a gateway restart.
  • Verify that the agent:main:main session is properly connected and configured to handle p2p messages.
  • Consider implementing a mechanism to automatically restart or refresh the agent:main:main session after a gateway restart.
  • Review the logs to ensure that there are no other errors or issues that may be contributing to the problem.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The provided hypothesis suggests that the gateway restart disconnects the main session's message consumption loop, causing p2p messages to be queued but not processed. However, without further information or logs, it's difficult to determine the root cause of the issue.

Recommendation

Apply the workaround of sending a message in a group chat that mentions the bot after every openclaw gateway restart to "wake up" the main session and process queued p2p messages, until a more permanent solution can be implemented.

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 P2P messages stuck with replies=0 after gateway restart [2 comments, 2 participants]