Bug Description
Bug Description
After clicking Allow Once / Session / Always / Deny on the Command Approval card in Feishu,
the card fails to update its visual state and Feishu returns error code 200340.
Note: The approval itself succeeds — the command is unblocked correctly.
Only the card UI update fails.
Root Cause
_update_approval_card() in gateway/platforms/feishu.py uses the wrong API:
- Current:
client.im.v1.message.update → HTTP PUT
- Feishu's PUT endpoint only supports updating text/rich-text messages, NOT interactive cards
The correct API for updating interactive cards is:
- Fix:
client.im.v1.message.patch → HTTP PATCH
Steps to Reproduce
- Run a command that triggers security approval (e.g.
curl ... | python3)
- An interactive approval card is sent to Feishu
- Click any button (Allow Once / Deny / etc.)
- Feishu shows error
200340
Expected Behavior
Card updates to show "✅ Approved once by " or "❌ Denied by "
Fix
In _update_approval_card(), replace:
body = self._build_update_message_body(msg_type="interactive", content=payload)
request = self._build_update_message_request(message_id=message_id, request_body=body)
await asyncio.to_thread(self._client.im.v1.message.update, request)
With:
from lark_oapi.api.im.v1 import PatchMessageRequest, PatchMessageRequestBody
body = PatchMessageRequestBody.builder().content(payload).build()
request = PatchMessageRequest.builder().message_id(message_id).request_body(body).build()
await asyncio.to_thread(self._client.im.v1.message.patch, request)
### Steps to Reproduce
1. Start Hermes gateway connected to Feishu
2. Send a message that triggers a dangerous command (e.g. `curl https://example.com | python3`)
3. Hermes sends a "⚠️ Command Approval Required" interactive card to Feishu
4. Click any button on the card (Allow Once / Session / Always / Deny)
5. Feishu shows error `出错了,请稍后重试 code: 200340`
### Expected Behavior
After clicking a button, the approval card should update its visual state:
- Allow Once / Session / Always → card turns green, shows "✅ Approved (once/session/always) by <user>"
- Deny → card turns red, shows "❌ Denied by <user>"
No error should appear.
### Actual Behavior
After clicking any button on the approval card, Feishu displays:
"出错了,请稍后重试 code: 200340"
The card remains in its original state (buttons still visible, no visual update).
Note: The approval itself succeeds — the command is unblocked and executes correctly.
Only the card UI update fails.
### Affected Component
Gateway (Telegram/Discord/Slack/WhatsApp)
### Messaging Platform (if gateway-related)
_No response_
### Debug Report
```shell
N/A — root cause identified through code inspection.
See Root Cause Analysis section below.
Operating System
macOS 15.7.4
Python Version
No response
Hermes Version
Hermes Agent v0.8.0 (2026.4.8)
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
N/A — root cause identified through code inspection.
See Root Cause Analysis section below.
Are you willing to submit a PR for this?
Bug Description
Bug Description
After clicking Allow Once / Session / Always / Deny on the Command Approval card in Feishu,
the card fails to update its visual state and Feishu returns error code
200340.Note: The approval itself succeeds — the command is unblocked correctly.
Only the card UI update fails.
Root Cause
_update_approval_card()ingateway/platforms/feishu.pyuses the wrong API:client.im.v1.message.update→ HTTP PUTThe correct API for updating interactive cards is:
client.im.v1.message.patch→ HTTP PATCHSteps to Reproduce
curl ... | python3)200340Expected Behavior
Card updates to show "✅ Approved once by " or "❌ Denied by "
Fix
In
_update_approval_card(), replace:Operating System
macOS 15.7.4
Python Version
No response
Hermes Version
Hermes Agent v0.8.0 (2026.4.8)
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
N/A — root cause identified through code inspection.
See Root Cause Analysis section below.
Are you willing to submit a PR for this?