feat(feishu): upgrade askQuestion to interactive Card V2 forms#9613
Open
Damue01 wants to merge 1 commit into
Open
feat(feishu): upgrade askQuestion to interactive Card V2 forms#9613Damue01 wants to merge 1 commit into
Damue01 wants to merge 1 commit into
Conversation
54ad731 to
354c80e
Compare
8a7dc84 to
354c80e
Compare
RuckVibeCodes
left a comment
There was a problem hiding this comment.
[gus-first-pass] feat(feishu): upgrade askQuestion to interactive Card V2 forms - Clear feature addition, no issues found.
Replace plain-text clarify messages with Feishu Card V2 interactive forms that support single/multi-select options, freeform text input, and real-time inline response updates. Changes: - Extend clarify tool schema with structured questions array (header, options, multiSelect, allowFreeformInput) - Add send_clarify_prompt(questions=...) to gateway base adapter - Implement Card V2 form builder (_build_ask_form_card) and V1 button card (_build_clarify_card) with adaptive layout - Handle card action callbacks with sender name resolution via Contact API, return formatted answers as tool results - Inline card update via P2CardActionTriggerResponse (no separate edit_message call) - Wire questions param through gateway runner and run_agent dispatch - Strip leading newlines in streamed edits (stream_consumer fix) - Update CLI clarify callback for forward compatibility Tests: 173 passed (106 feishu + 36 approval + 31 clarify)
354c80e to
a8c0a83
Compare
Collaborator
|
Hi, I'm a daily Feishu user of Hermes Agent. This feature would be a huge improvement — currently the plain-text clarify flow on Feishu requires typing exact option text back, which is not user-friendly at all. Interactive Card V2 forms with native select menus would make the Feishu experience much better. Is it possible to evaluate and merge this soon? Many Feishu users would benefit from it. Thanks! |
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
Upgrade Feishu's
clarify/askQuestiontool from plain-text messages to interactive Card V2 forms with real-time inline response updates.Why
The existing plain-text clarify flow on Feishu requires users to type exact option text back — there's no visual structure, and multi-question forms are impossible. Card V2 forms provide native select menus, freeform text inputs, and multi-select checkboxes, matching Feishu's own product UX.
Changes
tools/clarify_tool.pyquestionsarray — each question supportsheader,options[],allowFreeformInput, andmultiSelectgateway/platforms/base.pysend_clarify_prompt(questions=...)to base adapter interfacegateway/platforms/feishu.py_build_clarify_card()(V1 button card),_build_ask_form_card()(V2 multi-field form),_build_inline_card_response()(inline update),_handle_card_action_event()(callback with sender name resolution)gateway/run.py_clarify_callback_syncto passquestionsto platform adapters; text fallback for non-card platformsgateway/stream_consumer.py\nfrom streamed edits to avoid blank-looking messagescli.py_clarify_callbackto accept**kwargsfor forward compatibilityrun_agent.pyquestionskwarg through both tool dispatch pathsHow it works
askQuestionwith structuredquestions→ adapter builds a Card V2 form (or falls back to V1 button card for single questions without freeform input).P2CardActionTriggerResponse(no separateedit_messagecall) → resolved answer is returned to the agent as the tool result.How to test
Manual testing: Start the gateway (
hermes gateway), send a message in Feishu that triggers the agent to ask a clarifying question — verify the card renders with selectable options and updates inline after selection.Test results
tests/gateway/test_feishu.pytests/gateway/test_feishu_approval_buttons.pytests/tools/test_clarify_tool.pyScreenshots
Platforms tested