#19254: fix(feishu): honor wildcard group config for reply policy
channel: feishu
size: S
Cluster:
Signal and Discord Fixes
## Summary
Fix Feishu group wildcard policy handling so `channels.feishu.groups["*"]` is applied when a specific group ID entry is missing.
Without this fallback, wildcard group settings (for example `requireMention: false`) are ignored for unmatched groups, causing group behavior to unexpectedly fall back to global defaults.
## Changes
- `extensions/feishu/src/policy.ts`
- In `resolveFeishuGroupConfig`, return the wildcard group config (`groups["*"]`) when no exact/case-insensitive match exists.
- `extensions/feishu/src/policy.test.ts` (new)
- Added tests for:
- wildcard fallback when direct group config is absent
- exact match taking precedence over wildcard
- case-insensitive explicit group ID matching still working
## Repro
1. Configure:
- `channels.feishu.groups["*"].requireMention = false`
- no explicit entry for a target group
2. Send a group message without mentioning the bot.
### Before
The wildcard was not applied; message could still be treated as mention-gated.
### After
The wildcard config is applied; behavior follows `groups["*"]` as expected.
## Validation
- Ran:
- `pnpm exec vitest run --config vitest.extensions.config.ts extensions/feishu/src/policy.test.ts`
- Result:
- `1 passed`, `3 passed`
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds wildcard fallback logic to `resolveFeishuGroupConfig` so that `channels.feishu.groups["*"]` configuration is properly applied when no explicit group ID match exists. This fixes unintended fallback to global defaults for unconfigured groups.
- **Logic change**: Returns wildcard config (`groups["*"]`) after exhausting exact and case-insensitive matching
- **Test coverage**: Added comprehensive tests validating wildcard fallback, precedence rules, and case-insensitive matching
- **Consistency**: Aligns with similar wildcard patterns in other channel extensions (e.g., IRC)
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is simple, well-tested, and follows established patterns in the codebase. The logic correctly implements wildcard fallback with proper precedence (exact > case-insensitive > wildcard). Tests cover all critical paths including edge cases.
- No files require special attention
<sub>Last reviewed commit: 2e8ec64</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#17513: fix(discord): respect groupPolicy in channel config fallback (#4555)
by aronchick · 2026-02-15
77.4%
#10309: fix: use group ID for peer.id in Feishu group messages
by ParsifalC · 2026-02-06
76.6%
#19793: feat(feishu): reply-in-thread, parallel group sessions, and fire-an...
by yinsn · 2026-02-18
74.9%
#13211: feat(feishu): skip reply-to in DM conversations
by Vincentwei1021 · 2026-02-10
74.6%
#21484: fix(feishu): scope message deduplication by accountId to support mu...
by guanyu-zhang · 2026-02-20
74.2%
#22675: feishu: move message dedup to just before dispatch
by zijiegeng · 2026-02-21
73.9%
#19027: fix(feishu): keep chunked messages in topic/thread context
by qiangu · 2026-02-17
73.6%
#11611: feat: separate group-level allowlist from sender-level command auth...
by thisnick · 2026-02-08
73.5%
#9253: Fix: Feishu chat ID mismatch causing session context confusion
by vishaltandale00 · 2026-02-05
72.8%
#6567: fix: include paired users in WhatsApp group sender allowlist
by giannisanni · 2026-02-01
72.5%