feat(feishu): support interactive card action (button) callbacks - #7
Open
Strivin0311 wants to merge 1 commit into
Open
feat(feishu): support interactive card action (button) callbacks#7Strivin0311 wants to merge 1 commit into
Strivin0311 wants to merge 1 commit into
Conversation
Register a card.action.trigger handler on the Feishu WSClient EventDispatcher
so that clicking an interactive card button routes back to the agent.
The button's action value is mapped into a synthetic text message and fed
through the existing processFeishuMessage pipeline, supporting shapes:
- { text: "up514" }
- { action: "up", pr: 514 } -> "up514"
This enables button-driven workflows (e.g. PR desc updates) over the
long-connection mode without needing a public callback URL.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
What
Add support for Feishu interactive card action (button) callbacks over the long-connection (WSClient) mode.
Previously the Feishu
EventDispatcheronly registeredim.message.receive_v1, so clicking a card button produced no effect (the platform reported error200672— no responder). This PR registers acard.action.triggerhandler so button clicks route back to the agent.How
mapFeishuCardActionToMessageconverts a card action payload into a synthetic textFeishuMessageItem, reusing the existingprocessFeishuMessagepipeline.valueshapes:{ text: "up514" }→ uses the text directly{ action: "up", pr: 514 }→ assembled into"up514"open_id/open_chat_id(withcontext.*fallback); the handler returns{}to acknowledge without updating the card.markFeishuEventSeenmechanism.Why
Enables button-driven workflows (e.g. one-click PR description updates) without requiring a public callback URL — it works purely through the already-configured long-connection callback subscription.
Testing
tsc --noEmit -p tsconfig.node.jsonpasses cleanly.feishuWsHeartbeatunit tests pass.feishuTransport/feishuWebhookTransportsuites fail locally due to a pre-existing Electron binary install issue in the dev env (fail identically on cleanmain), unrelated to this change.