openclaw - 💡(How to fix) Fix Sub-agent completion auto-announce silently fails in Discord group chats (source_reply_delivery_mode_mismatch)

Official PRs (…)
ON THIS PAGE

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…

When a sub-agent completes its work and OpenClaw tries to auto-announce the completion back to the requester session in a Discord group chat (/channel), the delivery silently fails with source_reply_delivery_mode_mismatch.

This causes the main agent (and the user) to never receive sub-agent completion notifications. The user has to manually ask "did the sub-agent finish?" after every spawn.

Root Cause

In runs-DrbsiywK.js (~line 147):

if (options?.sourceReplyDeliveryMode === "message_tool_only" 
    && handle.sourceReplyDeliveryMode !== "message_tool_only") {
    diagnosticLogger.debug("queue message failed: ... reason=source_reply_delivery_mode_mismatch");
    return { kind: "complete", outcome: createQueueFailureOutcome(sessionId, "source_reply_delivery_mode_mismatch") };
}

Discord group chats use sourceReplyDeliveryMode: "message_tool_only" (see bot-D0mzNk0g.js:6915sourceReplyDeliveryMode: isRoomEvent ? "message_tool_only" : void 0). When the sub-agent completion event tries to deliver back to the parent session, the handle.sourceReplyDeliveryMode doesn't match "message_tool_only", and the delivery is quietly dropped.

Fix Action

Fix / Workaround

This worked previously but broke at some point. The sessions_yield mechanism was a workaround (yield → wake on completion event), but even that has stopped working reliably in group chat contexts.

Code Example

if (options?.sourceReplyDeliveryMode === "message_tool_only" 
    && handle.sourceReplyDeliveryMode !== "message_tool_only") {
    diagnosticLogger.debug("queue message failed: ... reason=source_reply_delivery_mode_mismatch");
    return { kind: "complete", outcome: createQueueFailureOutcome(sessionId, "source_reply_delivery_mode_mismatch") };
}
RAW_BUFFERClick to expand / collapse

Description

When a sub-agent completes its work and OpenClaw tries to auto-announce the completion back to the requester session in a Discord group chat (/channel), the delivery silently fails with source_reply_delivery_mode_mismatch.

This causes the main agent (and the user) to never receive sub-agent completion notifications. The user has to manually ask "did the sub-agent finish?" after every spawn.

Root Cause

In runs-DrbsiywK.js (~line 147):

if (options?.sourceReplyDeliveryMode === "message_tool_only" 
    && handle.sourceReplyDeliveryMode !== "message_tool_only") {
    diagnosticLogger.debug("queue message failed: ... reason=source_reply_delivery_mode_mismatch");
    return { kind: "complete", outcome: createQueueFailureOutcome(sessionId, "source_reply_delivery_mode_mismatch") };
}

Discord group chats use sourceReplyDeliveryMode: "message_tool_only" (see bot-D0mzNk0g.js:6915sourceReplyDeliveryMode: isRoomEvent ? "message_tool_only" : void 0). When the sub-agent completion event tries to deliver back to the parent session, the handle.sourceReplyDeliveryMode doesn't match "message_tool_only", and the delivery is quietly dropped.

Impact

This worked previously but broke at some point. The sessions_yield mechanism was a workaround (yield → wake on completion event), but even that has stopped working reliably in group chat contexts.

Each sub-agent spawn requires manual user check-in to verify completion. This defeats the purpose of automated multi-agent orchestration.

Steps to Reproduce

  1. Be in a Discord group chat (not DM)
  2. Spawn a sub-agent via sessions_spawn
  3. Use sessions_yield to wait
  4. Sub-agent completes
  5. Neither the completion announcement nor the yield wake arrives
  6. The sub-agent completion event is logged as source_reply_delivery_mode_mismatch

Suggested Fix

The delivery failure at line 147 should fall through to an alternative delivery path instead of failing silently. Options:

  1. When source_reply_delivery_mode_mismatch occurs, deliver the completion as an internal systemEvent instead of dropping it
  2. Allow the yield-wake path to work independently of the source reply delivery path
  3. Add message_tool_only support to the session handle for group chat contexts

Environment

  • OpenClaw gateway running on Linux
  • Discord channel (#dev in guild)
  • Multi-agent orchestration via sessions_spawn + sessions_yield

Found by: Josephur (user) & Brachyura McCrabface (main agent)

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 Sub-agent completion auto-announce silently fails in Discord group chats (source_reply_delivery_mode_mismatch)