feat(feishu): opt-in approval mention notifications on exec prompts - #66780
feat(feishu): opt-in approval mention notifications on exec prompts#667809lie wants to merge 1 commit into
Conversation
Related to merged #60493, which implemented the analogous default-off Discord approval mentions. This PR ports the capability to Feishu. |
tonydwb
left a comment
There was a problem hiding this comment.
{
"event": "COMMENT",
Code Review Summary\n\nVerdict: Approved\n\nLooks good. No obvious issues found.\n\n---\nReviewed by Hermes Agent",
"comments": []
}
|
Thanks for the focused Feishu port. The runtime path is sound: the adapter initializes from Problems
Suggested changes
Automated hermes-sweeper review. |
Add feishu.approval_mentions config (default off). When enabled, exec-approval cards prepend <at user_id="ou_xxx"> for each configured admin open_id, so they receive a Feishu mention notification instead of silently waiting. Mirrors discord.approval_mentions (commit e0176cb): - Default off, opt-in via config.yaml - Only mentions admins with valid ou_ open_ids - Mention prepended to card markdown, before the code block - No gateway/run.py changes (adapter-internal, like Discord approach) Tests: 11 total (5 existing + 6 new covering mention rendering, config propagation, and edge cases).
b1905da to
af8190d
Compare
|
Documentation added per review feedback: |
What does this PR do?
Adds an opt-in Feishu (Lark) approval mention feature. When
feishu.approval_mentionsis enabled inconfig.yaml(undergateway.platforms.feishu.extra), dangerous-command approval cards prepend<at user_id="ou_xxx">for each configured admin so they receive a Feishu mention notification instead of silently waiting.The feature is default-off, only mentions admins with valid
ou_open_ids (Feishu<at>tag requires open_id format), and is implemented entirely within the Feishu adapter -- nogateway/run.pychanges.Related Issue
No issue linked. Duplicate/overlap search performed:
discord.approval_mentions(commit e0176cb, PR feat: optionally mention Discord approval owners #39719). This PR adds the same capability for Feishu, mirroring the config name, default, and adapter-internal approach.Type of Change
Changes Made
plugins/platforms/feishu/adapter.py:approval_mentions: bool = Falsefield toFeishuAdapterSettings_load_settingsparsesextra.get("approval_mentions")(also supportsFEISHU_APPROVAL_MENTIONSenv var)_apply_settingspropagates the setting to the adapter instancesend_exec_approvalbuilds a<at user_id="ou_xxx">mention prefix for each admin with a validou_open_id, prepended to the card markdown before the code blocktests/gateway/test_feishu_approval_buttons.py:_load_settings+_apply_settings), default-off behaviorHow to Test
Run tests:
All 11 tests pass (5 existing + 6 new).
Manual test on Feishu:
approval_mentions: trueundergateway.platforms.feishu.extrainconfig.yamlou_open_idgit reset --hardin a test repo)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/gateway/test_feishu_approval_buttons.py -vand all tests passDocumentation & Housekeeping
docs/, docstrings) - or N/Acli-config.yaml.exampleif I added/changed config keys - or N/A: Feishu has no existing config block incli-config.yaml.example; Discord'sapproval_mentions(commit e0176cb) also does not appear thereCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - or N/A: no architecture or workflow changesAlignment with Discord
discord.approval_mentionsfeishu.approval_mentionsou_open_ids<@uid><at user_id="ou_xxx">AllowedMentions(users only)<at>is inherently targeted)