hermes - 💡(How to fix) Fix Feishu: add send_slash_confirm with interactive card buttons

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Solution

Added send_slash_confirm to the Feishu adapter, modeled after the existing send_exec_approval method. The implementation sends an interactive card with three buttons, handles card-action callbacks in _on_card_action_trigger, and resolves via tools.slash_confirm.resolve().

RAW_BUFFERClick to expand / collapse

Problem

Feishu adapter does not override send_slash_confirm, so slash-command confirmation prompts (/new, /reset, /undo, /reload-mcp) fall back to plain text on Feishu.

Telegram, Discord, and Slack all render three inline buttons (Approve Once / Always Approve / Cancel). The base class docstring at gateway/platforms/base.py:1734 explicitly lists Feishu as a platform that should implement this:

Platforms with inline-button support (Telegram, Discord, Slack, Matrix, Feishu) should override this

Solution

Added send_slash_confirm to the Feishu adapter, modeled after the existing send_exec_approval method. The implementation sends an interactive card with three buttons, handles card-action callbacks in _on_card_action_trigger, and resolves via tools.slash_confirm.resolve().

Changes

Single file: gateway/platforms/feishu.py

  1. _SLASH_CONFIRM_CHOICE_MAP — maps button actions to choice strings (once/always/cancel)
  2. _slash_confirm_state in __init__ — stores confirm_id → {session_key, chat_id}
  3. send_slash_confirm — builds a 3-button interactive card and sends via _feishu_send_with_retry
  4. _on_card_action_trigger intercept — routes hermes_slash_confirm_action to the new handler
  5. _handle_slash_confirm_card_action — extracts confirm_id, looks up state, schedules async resolution, returns callback card
  6. _resolve_slash_confirm — calls tools.slash_confirm.resolve() and sends the result text
  7. _build_resolved_slash_confirm_card — builds the callback card shown after button click

Key design decisions

  • Button value only contains hermes_slash_confirm_action + confirm_id (compact, matching the approval card pattern). Session key is stored server-side in _slash_confirm_state to avoid hitting Feishu button value size limits.
  • Placed the hermes_slash_confirm_action check before the hermes_action check in _on_card_action_trigger to avoid collision with approval card actions.
  • Follows the exact same patterns as send_exec_approval / _handle_approval_card_action / _resolve_approval for consistency.

Testing

Verified on Feishu DM with /reload-mcp:

  • Card renders with 3 buttons
  • Button click triggers callback
  • slash_confirm.resolve() unblocks the gateway
  • Callback card shows resolved state
  • Follow-up text message delivered

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING