Problem
When Hermes runs terminal commands, the Feishu client shows "Command Approval Required". Clicking "Allow once", "Always", or "Deny" all result in error code 200340. The card action callback is not properly handled.
This is a high-frequency recurring issue with multiple attempted fixes:
Root Cause
The approval card is created as an interactive message but updated using the wrong API:
- Should use:
im.v1.message.patch (message patch, not card update)
- Card action callback routing in
_handle_card_action_event() is also incorrect
Reference
Upstream fixes:
OpenClaw design:
card-interaction.ts: Structured envelope with version ocf1
card-ux-approval.ts: Complete approval UX lifecycle
- Uses
FeishuStreamingSession for real-time card updates
Implementation Plan
- Fix
_resolve_approval() in gateway/platforms/feishu.py to use PATCH message API
- Ensure card action callback extracts
message_id correctly from event context
- Verify the card
update_id is properly passed for deduplication
- Test with actual Feishu approval flow
Problem
When Hermes runs terminal commands, the Feishu client shows "Command Approval Required". Clicking "Allow once", "Always", or "Deny" all result in error code 200340. The card action callback is not properly handled.
This is a high-frequency recurring issue with multiple attempted fixes:
Root Cause
The approval card is created as an
interactivemessage but updated using the wrong API:im.v1.message.patch(message patch, not card update)_handle_card_action_event()is also incorrectReference
Upstream fixes:
OpenClaw design:
card-interaction.ts: Structured envelope with versionocf1card-ux-approval.ts: Complete approval UX lifecycleFeishuStreamingSessionfor real-time card updatesImplementation Plan
_resolve_approval()ingateway/platforms/feishu.pyto use PATCH message APImessage_idcorrectly from event contextupdate_idis properly passed for deduplication