← Back to PRs

#17863: Fix Feishu card button callback parameters dropped (missing handler)

by Clawborn open 2026-02-16 07:47 View on GitHub →
channel: feishu stale size: S trusted-contributor
## Description Feishu card interactions (button clicks) trigger a `card.action.trigger` event, which was previously ignored by the bot monitor. This meant button clicks had no effect and parameters were lost. ## Fix - Registered handler for `card.action.trigger`. - Added adapter (`src/feishu/card-action.ts`) to convert card actions into synthetic message events so they can be processed by the agent (supporting `value` as text or JSON). ## Tests Added `extensions/feishu/src/bot.card-action.test.ts` verifying: - Card action with `text` payload is converted to message - Card action with JSON object payload is converted to message ## AI Transparency - **Assisted by**: OpenClaw Agent (Claude 3.5 Sonnet / Opus) - **Testing level**: Fully tested with new unit tests (`extensions/feishu/src/bot.card-action.test.ts`) - **Prompt strategy**: Self-correction loop based on codebase analysis <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds a handler for Feishu card button click events (`card.action.trigger`), which were previously silently ignored. The new `card-action.ts` adapter converts card action payloads into synthetic `FeishuMessageEvent` objects so they can be processed through the existing message pipeline. The monitor registers the new event handler following the same pattern as existing handlers. - **Critical bug**: The synthetic `message_id` is built from `event.token`, which is the app's verification token (shared across all events), not a unique event identifier. This will cause the dedup module (`tryRecordMessage`) to silently drop all card actions after the first one within a 30-minute window. - Tests cover text and JSON payload conversion but don't exercise the dedup interaction, so they don't catch the token reuse issue. - The overall adapter pattern (converting card actions into synthetic messages) is a clean approach that reuses the existing message handling pipeline effectively. <h3>Confidence Score: 2/5</h3> - This PR has a bug that will cause card button clicks to stop working after the first click — should be fixed before merge. - The dedup bug with `event.token` being the app verification token (not a unique event ID) means only the first card button click will be processed; all subsequent clicks within 30 minutes will be silently dropped. This effectively renders the feature broken after one use per app. - `extensions/feishu/src/card-action.ts` line 59 — the `message_id` generation using `event.token` needs to use a unique identifier instead. <sub>Last reviewed commit: d85762b</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs