Skip to content

P2P messages stuck with replies=0 after gateway restart #58953

@yc111233

Description

@yc111233

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions