Conversation
Related: #6422 (same |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting the live Feishu plugin path. The defect remains on current main: plugins/platforms/feishu/adapter.py:3009 places the card callback token in MessageEvent.message_id; gateway/platforms/base.py:107 then uses that value as the reply anchor, and plugins/platforms/feishu/adapter.py:4613-4621 sends it to Feishu's reply endpoint.
Problems
- The PR has no regression test. The shared callback fixture at
tests/gateway/test_feishu_approval_buttons.py:57-74exposes onlyopen_chat_id, andTestNonApprovalCardAction.test_routes_as_synthetic_commandat lines 417-438 never asserts the emitted event ID.
Suggested changes
- Add
open_message_idto the fixture and assert that a non-approval card action uses it asMessageEvent.message_id; retain fallback coverage for absent context IDs.
Automated hermes-sweeper review.
| @@ -2893,7 +2894,7 @@ async def _handle_card_action_event(self, data: Any) -> None: | |||
| message_type=MessageType.COMMAND, | |||
There was a problem hiding this comment.
Please add focused coverage for this path: provide context.open_message_id in the card-action fixture and assert that the dispatched synthetic event uses it as message_id. The existing non-approval card-action test only checks the generated text.
When a Feishu interactive card button is clicked, the agent fails to send a reply with: [99992354] Invalid ids: [c-...] Root cause: _handle_card_action_event() sets message_id to the card action token (format c-xxx), but the Feishu ReplyMessage API requires an open_message_id (format om_xxx). P2CardActionTriggerData.CallBackContext already provides the open_message_id field, but the adapter only extracted open_chat_id while ignoring open_message_id. Two-line fix in plugins/platforms/feishu/adapter.py: 1. Extract open_message_id from CallBackContext 2. Prefer open_message_id as message_id (fall back to token/uuid) Regression tests added in tests/gateway/test_feishu_approval_buttons.py: - test_uses_open_message_id_when_available: verifies om_xxx is used when present in the callback context - test_falls_back_to_token_when_open_message_id_absent: verifies token fallback when open_message_id is absent All 40 tests pass.
6219408 to
dac9b59
Compare
When a Feishu interactive card button is clicked, the agent fails to send a reply with: 'Invalid ids: [c-...]'. The root cause is that _handle_card_action_event() sets message_id to the card action token (format c-xxx), but the Feishu ReplyMessage API requires an open_message_id (format om_xxx).
P2CardActionTriggerData.CallBackContext already provides the open_message_id field, but the adapter only extracted open_chat_id from it while ignoring open_message_id.
Two-line fix:
What does this PR do?
Related Issue
Fixes #
Type of Change
Changes Made
How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs