-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Feishu card action handler discards action.option, action.options, and action.form_value #42754
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.clownfishTracked by Clownfish automationTracked by Clownfish automationenhancementNew feature or requestNew feature or requestimpact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.clownfishTracked by Clownfish automationTracked by Clownfish automationenhancementNew feature or requestNew feature or requestimpact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
Extract
action.option,action.options, andaction.form_valuefrom Feishu card action callbacks inhandleFeishuCardAction, so plugins can receive dropdown selections, multi-select choices, and form submissions.Problem to solve
handleFeishuCardActioninextensions/feishu/src/card-action.tsonly readsaction.valuefrom Feishu card callbacks. However, Feishu card components place their interaction data in separate fields depending on the component type:buttonaction.value(with.commandor.text)select_static(dropdown)action.optioncheckbox/ multi-selectaction.optionsformsubmissionaction.form_valueThe root cause is that
FeishuCardActionEventtype definition only modelsaction.valueandaction.tag:The actual Feishu callback payload includes
option,options, andform_valuefields that are silently dropped at the TypeScript type level. This means plugin developers cannot receive dropdown selections, multi-select choices, or form submissions from Feishu interactive cards.The only workaround is replacing all dropdowns with button matrices encoding state into
value.command, which significantly degrades UX for selections with many options.Proposed solution
Extend
FeishuCardActionEventto include the missing fields and update the content extraction logic (~30 lines, fully backward-compatible):option?: string,options?: string[],form_value?: Record<string, unknown>toactionoption/options/form_valuebefore falling through to the existingvalue.text/value.commandpathvalueobject into a single JSON stringExisting button flows (
value.textandvalue.command) are completely unaffected — the new extraction only activates whenoption,options, orform_valueare present.Before (select_static — agent receives useless static value):
After (select_static — agent receives complete data):
Alternatives considered
Button matrix workaround: Replace all
select_staticdropdowns with button groups, encoding state intovalue.command. This works but degrades UX significantly when there are many options (>5), and cannot support multi-select or form submission scenarios at all.Plugin-level HTTP callback proxy: Use
registerHttpRouteto self-host a card callback endpoint. This requires extra infrastructure configuration (Feishu app "card request URL" setting) and complex message injection logic viabefore_prompt_build, making it fragile and hard to maintain.Impact
Evidence/examples
The same gap was fixed in official Feishu SDKs:
larksuite/oapi-sdk-pythonPR #75 — addedform_valueto Action classlarksuite/oapi-sdk-javaIssue #118 — reported missing card callback fieldsThe community
feishu-interactive-cardsskill works around this by using button-only cards with all state encoded invalue, confirming thatselect_staticis unusable through the current handler.Additional information
I'm happy to submit a PR for this. The change is small (~30 lines code + ~50 lines tests in
bot.card-action.test.ts) and fully backward-compatible with existing button-based card interactions.AI-assisted analysis (Claude via Cursor), verified against current main branch source code.