Bug Description
When Hermes Gateway is running on the Feishu (Lark) platform and a dangerous command triggers the "Command Approval Required" interactive card, clicking any of the approval buttons (Allow Once, Session, Always, Deny) returns the error:
"出错了,请稍后再试 code: 220340"
The approval action is never processed — the agent remains blocked waiting for a response.
Steps to Reproduce
- Connect Hermes Gateway to Feishu platform
- Trigger a command that requires approval (e.g.,
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -)
- The bot sends an interactive card with buttons: ✅ Allow Once, ✅ Session, ✅ Always, ❌ Deny
- Click any button
- Error returned: "出错了,请稍后再试 code: 220340"
Expected Behavior
Clicking an approval button should resolve the pending approval and unblock the agent, executing or denying the command accordingly.
Actual Behavior
Feishu returns error code 220340 when the bot tries to call im.message.update (or equivalent card update API) to replace the approval card with a resolution card (e.g., "Approved by user"). The approval resolution logic itself appears correct (_resolve_approval is called, resolve_gateway_approval succeeds), but the subsequent card update fails.
Root Cause Analysis
In gateway/platforms/feishu.py, the method _handle_approval_card_action:
- Successfully extracts
approval_id and maps the button click to a choice
- Successfully schedules
_resolve_approval() via asyncio.run_coroutine_threadsafe() — the approval is resolved
- Attempts to update the approval card by returning a
P2CardActionTriggerResponse with a CallBackCard containing the resolution text
The error 220340 is a Feishu API error (not a Hermes error code) that occurs when the bot attempts to update the message/card. Possible causes:
- Permission issue: The bot may not have
im:message write permission for the specific chat
- Message ID issue: The
message_id stored in _approval_state may not be the correct open_chat_id format needed for im.message.update
- Card update restriction: Feishu interactive cards may not support
update operations on cards that were sent as new messages (vs. message replies)
Environment
- Hermes Agent version: v0.10.0 (2026.4.16)
- Platform: Feishu/Lark (gateway)
- Python: 3.11
Workaround
Use /approve or /deny slash commands instead of clicking the interactive card buttons.
Tags
bug
platform:feishu
priority:medium
Bug Description
When Hermes Gateway is running on the Feishu (Lark) platform and a dangerous command triggers the "Command Approval Required" interactive card, clicking any of the approval buttons (Allow Once, Session, Always, Deny) returns the error:
The approval action is never processed — the agent remains blocked waiting for a response.
Steps to Reproduce
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -)Expected Behavior
Clicking an approval button should resolve the pending approval and unblock the agent, executing or denying the command accordingly.
Actual Behavior
Feishu returns error code 220340 when the bot tries to call
im.message.update(or equivalent card update API) to replace the approval card with a resolution card (e.g., "Approved by user"). The approval resolution logic itself appears correct (_resolve_approvalis called,resolve_gateway_approvalsucceeds), but the subsequent card update fails.Root Cause Analysis
In
gateway/platforms/feishu.py, the method_handle_approval_card_action:approval_idand maps the button click to a choice_resolve_approval()viaasyncio.run_coroutine_threadsafe()— the approval is resolvedP2CardActionTriggerResponsewith aCallBackCardcontaining the resolution textThe error
220340is a Feishu API error (not a Hermes error code) that occurs when the bot attempts to update the message/card. Possible causes:im:messagewrite permission for the specific chatmessage_idstored in_approval_statemay not be the correctopen_chat_idformat needed forim.message.updateupdateoperations on cards that were sent as new messages (vs. message replies)Environment
Workaround
Use
/approveor/denyslash commands instead of clicking the interactive card buttons.Tags
bugplatform:feishupriority:medium