Repository navigation
fix(feishu): preserve card actions through mention gating - #116105
Patrick-Erichsen merged 2 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 29, 2026, 6:43 PM ET / 22:43 UTC. ClawSweeper reviewWhat this changesThis PR adds synthetic bot-mention metadata to authenticated Feishu group card-action callbacks so they pass existing Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain Keep this PR open. The narrow approach—representing an authenticated synthetic group callback as mentioning the resolved Feishu bot—preserves the established admission contract better than bypassing Priority: P1 Review scores
Verification
How this fits togetherFeishu structured-card actions arrive as authenticated callbacks and are converted into synthetic inbound messages before entering the normal Feishu message-admission flow. The group mention policy then determines whether the callback reaches the agent and reply dispatcher. flowchart LR
A[Feishu card button] --> B[Authenticated card callback]
B --> C[Synthetic inbound message]
C --> D[Group mention admission]
D --> E[Agent dispatch]
E --> F[Reply dispatcher]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +55, Tests +29. Total +84 across 3 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Obtain redacted after-fix evidence from a real Feishu/provider-runtime callback showing that a button click in a Do we have a high-confidence way to reproduce the issue? Yes, from source-level evidence: an authenticated group card callback is synthesized and then subjected to the normal mention gate, while the added lifecycle scenario demonstrates the intended failing boundary. This review does not have independent live Feishu reproduction evidence. Is this the best way to solve the issue? Yes, conditionally: adding valid mention metadata to the synthetic group message is narrower and more maintainable than bypassing AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 5141a3593c4c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Addressed the hosted precise OpenGrep finding in Validation after the repair: 152 focused Feishu tests passed, along with the Feishu extension typecheck, formatting, type-aware lint, max-lines, conflict-marker, and diff checks. The fresh precise OpenGrep scan and Opengrep OSS check both pass. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
MixxyAI
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. I like that it keeps the normal mention gate instead of adding a broad bypass. I found one scope edge case in the shared dispatcher that may be worth making explicit before merge; details inline.
| params.event, | ||
| params.command, | ||
| resolvedChatType, | ||
| params.botOpenId, |
There was a problem hiding this comment.
I think this may also change legacy behavior unintentionally. dispatchSyntheticCommand() is used by the decoded.kind === "legacy" fallback at the end of handleFeishuCardAction, so passing botOpenId here causes any non-ocf1 group card payload to receive synthetic mentions and pass requireMention. Those legacy payloads do not go through the structured envelope's expiry, expected-user, or expected-conversation checks.
The PR description scopes the fix to structured-card callbacks. Would it be safer to make this opt-in from the structured branch (for example, with an explicit satisfyMentionGate flag), or is widening legacy group-card behavior intentional? A regression test using a raw { command: "/help" } payload in a requireMention: true group would make the contract clear.
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
No blocking code findings. The mention synthesis is the best fix: it represents a card click as addressing the bot while preserving the normal group/sender admission path, instead of bypassing requireMention by synthetic message ID.
I also traced the legacy-path concern. Both WebSocket and webhook card callbacks cross a provider-authenticated transport boundary before handleFeishuCardAction; the legacy branch still represents a user clicking a bot card. Its lack of structured expiry/user/chat bindings is separate from mention semantics, and group plus sender policy remains enforced. I therefore consider the legacy widening intentional/acceptable. A raw legacy regression case would document that contract, but I do not consider it a merge blocker.
The remaining blocker is live Feishu proof: in a real group with requireMention: true, click a current structured card and show that it reaches dispatch, then show that an ordinary unmentioned group message is still dropped. This machine's live OpenClaw config has no Feishu tenant, so I could not produce that provider proof here.
…id-retention * origin/main: (83 commits) refactor(channels): own account config mutations (openclaw#115970) fix(discord): keep activity receipts in adopted threads (openclaw#116119) fix(feishu): preserve card actions through mention gating (openclaw#116105) perf(gateway): cache lazy server methods import (openclaw#116060) refactor: keep update timing constants private fix: reject stale update reconciliation refactor: keep update status response private fix: bound update status reconciliation fix: preserve uncertain update outcomes refactor: keep update reconciliation within size budgets fix: release update reconciliation on access loss docs: note control ui update reconciliation test: cover both managed update response orders fix: reconcile ambiguous gateway updates fix(codex): prevent approval promotion from blocking unattended runs (openclaw#116117) fix(daemon): require system-scope ownership before removing the user unit fix(daemon): only treat same-canonical-name user+system units as dueling fix(daemon): detect and resolve dueling user+system systemd gateway units fix(macos): back off approval socket retries (openclaw#116125) test: add stalled provider response body timeout coverage ...
* origin/main: (23 commits) refactor(channels): own account config mutations (openclaw#115970) fix(discord): keep activity receipts in adopted threads (openclaw#116119) fix(feishu): preserve card actions through mention gating (openclaw#116105) perf(gateway): cache lazy server methods import (openclaw#116060) refactor: keep update timing constants private fix: reject stale update reconciliation refactor: keep update status response private fix: bound update status reconciliation fix: preserve uncertain update outcomes refactor: keep update reconciliation within size budgets fix: release update reconciliation on access loss docs: note control ui update reconciliation test: cover both managed update response orders fix: reconcile ambiguous gateway updates fix(codex): prevent approval promotion from blocking unattended runs (openclaw#116117) fix(daemon): require system-scope ownership before removing the user unit fix(daemon): only treat same-canonical-name user+system units as dueling fix(daemon): detect and resolve dueling user+system systemd gateway units fix(macos): back off approval socket retries (openclaw#116125) test: add stalled provider response body timeout coverage ...
…16105) * fix(feishu): preserve card actions through mention gating * test(feishu): use structured card action fixtures
What Problem This Solves
Feishu and Lark group users can click an authenticated structured-card button and have the callback silently dropped when the group uses
requireMention: true. The callback enters the normal group admission path without bot-mention metadata, so the agent never receives the action. Fixes #85450.Why This Change Was Made
The card-action handler now adds the already-resolved bot
open_idas Feishu mention metadata only when it builds a synthetic group callback. This makes the callback satisfy the existing mention contract instead of adding a broad bypass based on a synthetic message-ID prefix. Direct-message callbacks remain unchanged, and a missing bot identity does not fabricate a mention.Thanks to @googlerest in #85481 and @zhouhe-xydt in #85609 for the earlier investigations. Both proposals were closed unmerged; this replacement validates the current monitor lifecycle and preserves the current admission policy.
User Impact
Card buttons such as approval confirmations and quick actions work in groups that require bot mentions. Ordinary unmentioned group messages are still rejected, and direct-message card callbacks do not gain synthetic mention metadata.
Evidence
Base
cff7cbfdcb8089e5005e3549153e131347aeb198; head403df4cd76f82a6b5f4f636b47e6e19ead8c380f.Before the production change, the new current-main lifecycle regression failed with zero agent dispatches for an authenticated group callback under
requireMention: true.After the change, 152 focused Feishu tests passed across the card-action handler, real monitor lifecycle, bot admission, and policy suites. The lifecycle regression proves the callback reaches the agent; the adjacent policy tests prove ordinary mention gating remains intact.
The first hosted precise OpenGrep run found two legacy raw-command fixtures in the now-touched lifecycle test. Head
403df4cd76f82a6b5f4f636b47e6e19ead8c380fconverts them to the structured interaction envelope while preserving their no-outer-context and no-reply-target cases. The same 152 focused tests pass after that repair, and both the fresh precise OpenGrep scan and Opengrep OSS check pass.The Feishu extension TypeScript check passed after refreshing the repository's generated Plugin SDK declarations.
Oxfmt, type-aware oxlint, max-lines ratchet, conflict-marker scan, and diff checks passed for the three-file change.
A live Feishu tenant was not available locally, so maintainer provider validation remains authoritative.