fix(gateway/feishu): bridge yaml group_rules/admins/default_group_policy to extra - #42790
fix(gateway/feishu): bridge yaml group_rules/admins/default_group_policy to extra#42790paid wants to merge 1 commit into
Conversation
…icy to extra FeishuAdapter._load_settings() reads group_rules/admins/default_group_policy from PlatformConfig.extra, but gateway/config.py only forwarded allow_bots from yaml feishu.* to extra. Per-group require_mention overrides written under feishu.group_rules.<chat_id> in config.yaml were silently dropped. Bridge mirrors the existing allow_bots pattern: only forward keys that are explicitly present, so 'no group_rules' stays observably distinct from 'empty group_rules'. Other platforms (slack, telegram, whatsapp, signal, dingtalk, matrix) have analogous bridges for their structured fields; this brings feishu in line. Tests: tests/gateway/test_config.py - test_bridges_feishu_group_rules_from_config_yaml_to_extra - test_feishu_no_structured_fields_leaves_extra_clean
|
Verification comment (automated review) Reviewed the diff — the bridge logic is correctly placed after the shared Test coverage is thorough:
No issues found. Clean, well-scoped fix. |
|
Thanks for isolating the configuration propagation gap and adding focused regression coverage. Problems
Suggested changes
Automated hermes-sweeper review. |
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs address the same Feishu YAML propagation bug: both forward group_rules, admins, and default_group_policy into PlatformConfig.extra, but #42790 patches the removed legacy core path while #64285 implements the fix in the current plugin-owned YAML hook.
Related pull requests
- #42790
related— (+77/-0) — superseded by #64285: The diff correctly models explicit-key forwarding and absence semantics, but it modifies the legacygateway/config.pyFeishu block that no longer exists on current main. Despite the keep_open review on #42790, the current architecture requires this logic in the bundled Feishu plugin hook, which #64285 already implements with equivalent regression coverage. - #64285
duplicate— (+104/-3) — merge candidate: The diff fixes the live path by returning the three structured fields fromplugins/platforms/feishu/adapter.py::_apply_yaml_config, allowing the existing dispatcher to merge them intoPlatformConfig.extra; its tests cover hook behavior, end-to-end adapter loading, and absent-key semantics. This addresses the ownership concern in the keep_open review on #64285.
Duplicates
#42790 and #64285 target the same underlying propagation gap and forward the same three Feishu fields; #64285 is the current-main, plugin-owned implementation and therefore supersedes #42790.
Suggested consolidation
Merge #64285 because its diff applies the fix at the current Feishu plugin ownership boundary and includes both unit and end-to-end regression coverage. Close #42790 as superseded by #64285; although its review said keep_open for salvage, the requested rehome has already been completed in #64285.
Complex graph
flowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
subgraph Dup42790 ["PRs duplicating each other"]
P42790["PR #42790 (open)"]
P64285["PR #64285 (open)"]
end
class P42790 open
class P64285 open
class P42790 target
click P42790 "https://github.com/NousResearch/hermes-agent/pull/42790"
click P64285 "https://github.com/NousResearch/hermes-agent/pull/64285"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 11 kB of PR diffs, 5 kB of issue/PR text, 3 kB of discussion (5 comments), 1 verify verdict. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
Problem
FeishuAdapter._load_settings()(gateway/platforms/feishu.pyL1473-1572) readsgroup_rules,admins, anddefault_group_policyfromPlatformConfig.extra, butgateway/config.pyonly forwardsfeishu.allow_botsfromconfig.yaml— the structured fields are silently dropped.Symptom
Users who configure per-group
require_mentionoverrides inconfig.yaml(e.g. "this one group doesn't need @, all other groups still do") find the override completely ignored, even afterhermes gateway restart.Repro:
With
FEISHU_REQUIRE_MENTION=true(the default), the per-group override is expected to make that one chat respond without@bot. Before this fix the override is dropped during yaml→adapter bridging, so the chat still requires@bot. Adapter logic itself (_require_mention_for, L4040-4044) is correct — it just never receives the rules.Fix
Mirror the existing
allow_botsbridge: explicitly forward each Feishu-specific structured key when present, so absence stays observably distinct from "empty dict". Other platforms (slack, telegram, whatsapp, signal, dingtalk, matrix) already have analogous structured-key bridges; this brings feishu in line.Tests
Two new tests in
tests/gateway/test_config.py:test_bridges_feishu_group_rules_from_config_yaml_to_extra— positive case covering all three structured fields (group_rules with nested require_mention + policy/allowlist, admins list, default_group_policy)test_feishu_no_structured_fields_leaves_extra_clean— negative case ensuring the bridge does NOT inject empty placeholder keys when the yaml has no structured fields (presence is observably meaningful to the adapter)Both pass;
tests/gateway/test_config.pyis 50/50 green after the change.Notes
Full test suite has some pre-existing pollution-sensitive failures unrelated to this PR — they all pass when run in isolation. Verified that running
test_config.pytogether with any of the affected files (e.g.test_telegram_model_picker.py::test_model_selected_edits_message_on_success) in isolation passes cleanly, so this PR is not the source of the pollution.Risk
Low. The bridge only adds three keys to
PlatformConfig.extrawhen explicitly present inconfig.yaml. No env-var precedence is changed. Pure additive forwarding — nothing in the existing code path is removed or reordered.