fix(feishu): set CommandSource and GroupId for group messages#79556
fix(feishu): set CommandSource and GroupId for group messages#79556wangdingxin wants to merge 3 commits into
Conversation
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 "/".
|
Codex review: needs real behavior proof before merge. Reviewed June 2, 2026, 1:08 AM ET / 05:08 UTC. Summary PR surface: Source +5, Tests +2. Total +7 across 2 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model gpt-5.5, reasoning high; reviewed against ebf20241bd17. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5, Tests +2. Total +7 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
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 pull request has been automatically marked as stale due to inactivity. |
Summary
修复飞书群组消息的两个问题:
CommandSource字段,导致 slash 命令无法被正确识别groupId被错误设置为发送者的open_id,导致工具策略校验失败Changes
bug #79409 修复
buildCtxPayloadForAgent中,当消息是文本命令(以/开头)时,设置CommandSource: "text"isExplicitSourceReplyCommand()能正确识别飞书的文本命令bug #78826 修复
finalizeInboundContext调用中添加GroupId: ctx.chatId(仅对群组消息)From字段解析Testing
本地测试验证:
From格式:feishu:${senderOpenId}(不包含群组信息)GroupId字段后,resolveGroupSessionKey()能正确获取群组 IDFiles Changed
extensions/feishu/src/bot.tsCommandSource: "text"和GroupId字段Fixes #79409
Fixes #78826