fix: propagate requester channel in subagent announce flow#1773
Open
BingqingLyu wants to merge 3 commits into
Open
fix: propagate requester channel in subagent announce flow#1773BingqingLyu wants to merge 3 commits into
BingqingLyu wants to merge 3 commits into
Conversation
…coding webchat (openclaw#55931) Both wake and completion announce flows hardcode sourceChannel to INTERNAL_MESSAGE_CHANNEL ("webchat"), causing subagent completion events to always report webchat as origin regardless of actual channel. This misroutes responses when the parent session originated from Telegram, Feishu, WhatsApp, etc. Fix: use params.requesterOrigin?.channel with INTERNAL_MESSAGE_CHANNEL as fallback, preserving the actual delivery channel through the subagent lifecycle. Fixes openclaw#55931
… requesterOrigin The wake function's params type does not include requesterOrigin (it's an internal system-triggered flow). Only the completion announce path in runSubagentAnnounceFlow should use the requester's channel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes openclaw#55931
runSubagentAnnounceFlow()hardcodessourceChannel: INTERNAL_MESSAGE_CHANNEL("webchat") in both the descendant wake path (line 273) and the completion announce path (line 607). This causes all subagent completion events to reportsourceChannel: "webchat"regardless of the actual originating channel, misrouting responses when the parent session came from Telegram, Feishu, WhatsApp, Slack, etc.Changes
In
src/agents/subagent-announce.ts:INTERNAL_MESSAGE_CHANNEL→params.requesterOrigin?.channel ?? INTERNAL_MESSAGE_CHANNELBoth call sites already receive
params.requesterOrigin?: DeliveryContextwhich carries the original channel. The fix simply threads it through instead of discarding it. Falls back toINTERNAL_MESSAGE_CHANNELwhen no requester origin is available (e.g., internally triggered subagents).Test plan
sourceChannel: "telegram"instead of"webchat"🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com