Repository navigation
Conversation
PR 103587 — Feishu: interactive card surfaces for /model, /l, and second-step pickersSummary: Adds Feishu Non-blocking findings:
Tests: New suites ( |
Bin-Peng
force-pushed
the
pr-feishu-cards
branch
from
October 4, 2026 16:52
695baf7 to
b60f437
Compare
This branch has not been deployed
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 does this PR do?
Brings the interactive-card surfaces the gateway already exposes for Telegram/Discord/Slack/Matrix to the Feishu adapter, so Feishu stops silently degrading to text listings:
/modelsends aselect_staticmodel-picker card (full provider catalog) instead of the text fallback/l(alias/list) sends a quick-command menu card with server-side allowlisted button dispatch; every non-Feishu surface falls back to/commandsselect_staticcallback parsing walks the action payload recursively across SDK/callback shapes (action.option.valueas str or dict,action.value.key, nested option objects) instead of assuming one fixed shape, and logs a WARNING for still-unmatched callbacks so the real payload shape can be root-caused fromgateway.logmessage_idis a callback token/UUID, not an Feishuopen_message_id, so replying to it makes the API reject the follow-up with99992354 (invalid open_message_id). Card responses are sent as fresh messages instead.Related Issue
Feature requests: #20520, #23588 (interactive model picker for Feishu).
Related but not fixed here: #122649 ("Feishu approval card button click not responding") is the same class of payload-shape fragility at a different call site —
_on_card_action_trigger'shermes_actionlookup still requires the action value to be adict, while Feishu can deliver a namespace object. This PR fixes the picker path only; the approval path is left untouched to keep the change reviewable.Type of Change
Changes Made
plugins/platforms/feishu/adapter.pysend_model_picker,send_choice_picker,send_command_list; recursiveselect_staticvalue extraction; card-callback dispatch; one-shot picker stategateway/platforms/base.py99992354fix)gateway/slash_commands.py_handle_l_command— card on Feishu,/commandsfallback elsewherehermes_cli/commands.pyl(aliaslist) inCOMMAND_REGISTRYhermes_cli/commands_platforms.pylon Slack via/hermes lso/insightsstays under the 50-slash capgateway/run_busy.pylto the busy-path plain-command allowlisttests/gateway/test_feishu_approval_buttons.pytests/gateway/test_feishu_list_command.py/lmenu + registry casestests/gateway/test_feishu_choice_picker.pyRevision note
This revision narrows the PR to the Feishu feature only (the cron start-time/crash-artifact commit it previously carried has been split out; the drift measurement from that work is shared in #111454) and makes the suite green in an environment without platform extras, which is what CI installs.
How to Test
CI-equivalent runner, no platform extras installed, Python 3.14.7:
scripts/run_tests.sh tests/gateway/test_feishu_list_command.py tests/gateway/test_feishu_choice_picker.py tests/gateway/test_feishu_approval_buttons.py -q # → 3 files, 50 passed, 0 failedCovered: picker card rendering and one-shot consumption, tampered index, unauthorized user, chat mismatch,
/lallowlist dispatch, reply-anchor suppression for card callbacks, and the SDK-absent path: the adapter binds lark's card classes once at import time and returnsNonewhen they are unavailable, so the suites bind stand-in card classes only whenlark_oapiis missing — a real SDK keeps full fidelity.Manual: on a configured Feishu channel —
/model→ tap a model;/l→ tap a menu entry;/model→ second-step selection (reasoning/fast) → tap.Platform tested on: macOS 26.6.2 (Python 3.14.7, and 3.11.15 with
lark-oapiinstalled).Checklist
Code
feat(feishu): …)scripts/run_tests.shpasses on the affected suites (50 passed; the full suite was not run)Documentation & Housekeeping
cli-config.yaml.example— N/ACONTRIBUTING.md/AGENTS.md— N/ANote on overlapping work
Independent implementation. Other open work targets the same surface (#84476, #129974, #82170 and this one), plus feature requests #20520 / #23588. If the maintainers would rather consolidate on a different branch, say so and I'll close this or port the
99992354fix +select_staticrobustness there.