Skip to content

fix(feishu): approval card button clicks return error code 200340 #66

@bugmaker2

Description

@bugmaker2

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

  1. Fix _resolve_approval() in gateway/platforms/feishu.py to use PATCH message API
  2. Ensure card action callback extracts message_id correctly from event context
  3. Verify the card update_id is properly passed for deduplication
  4. Test with actual Feishu approval flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions