fix(feishu): set CommandSource=text for text slash commands#1
Open
wangdingxin wants to merge 3 commits into
Open
fix(feishu): set CommandSource=text for text slash commands#1wangdingxin wants to merge 3 commits into
wangdingxin wants to merge 3 commits into
Conversation
added 2 commits
May 8, 2026 23:28
Fixes openclaw#79409 - Feishu channel does not handle text slash commands The Feishu channel was not setting CommandSource when dispatching messages, causing slash commands like /compact, /new, /stop to be treated as regular messages instead of being intercepted by the command handler. This change follows the pattern used by other channels (Discord, Matrix, Tlon) which all set CommandSource: "text" for messages that start with "/".
When processing group messages, the From field only contains the sender's open_id (e.g. feishu:ou_sender_1), not the group chat ID. This caused resolveGroupSessionKey() to incorrectly extract the sender's open_id as the groupId, which then got dropped by resolveTrustedGroupId() since it doesn't match the actual group session context. Adding GroupId: ctx.chatId for group messages ensures the correct group chat ID is available to tool policy resolution, bypassing the malformed From field parsing. Fixes openclaw#78826
c931929 to
ee7f220
Compare
…essage tests Add explicit assertions for: - CommandSource: text in group slash command messages - GroupId in group message context These assertions verify the fixes for openclaw#79409 and openclaw#78826.
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#79409 - Feishu channel does not handle text slash commands (/compact, /new, /stop)
The Feishu channel was not setting
CommandSourcewhen dispatching messages, causing slash commands like/compact,/new,/stopto be treated as regular messages instead of being intercepted by the command handler.Root Cause
In
extensions/feishu/src/bot.ts, thebuildCtxPayloadForAgentfunction was not settingCommandSourcein the context payload. Other channels (Discord, Matrix, Tlon) all setCommandSource: "text"to indicate that the message is a text command.Fix
Added detection of text commands (messages starting with
/) and conditionally setCommandSource: "text"in the context payload, following the pattern used by other channels.Verification
/compactcommand works in Feishu/newcommand works in Feishu/stopcommand works in FeishuChanges
Fixes openclaw#79409