#17798: feat(feishu): support sender/topic-scoped group session routing
channel: feishu
size: S
Cluster:
Feishu Enhancements and Fixes
## Summary\n- add for Feishu group session routing\n- support scopes: , , , \n- keep backward compatibility by mapping legacy to when new scope is unset\n\n## Why\nCurrent default behavior scopes group conversations by , which can mix instructions from multiple senders in the same group. This change provides configurable isolation at sender/topic granularity.\n\n## Notes\n- default behavior remains unchanged ()\n- existing configs continue to work\n
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds a configurable `groupSessionScope` setting for Feishu group session routing, supporting four isolation modes: `group` (default, one session per group chat), `group_sender` (per sender), `group_topic` (per topic thread), and `group_topic_sender` (per topic+sender). The new setting is available at global, per-account, and per-group config levels.
- Introduces `GroupSessionScopeSchema` in `config-schema.ts` and registers it in `FeishuGroupSchema`, `FeishuAccountConfigSchema`, and `FeishuConfigSchema`
- Adds matching JSON schema entry in `channel.ts` for config validation
- Refactors the peer ID resolution in `bot.ts` from a narrow `topicSessionMode` guard to a `switch` over all four scope values
- Maintains backward compatibility: legacy `topicSessionMode: "enabled"` is automatically mapped to `group_topic` when `groupSessionScope` is not explicitly set
- Marks `TopicSessionModeSchema` as `@deprecated` in favor of `groupSessionScope`
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk — clean feature addition with proper backward compatibility.
- The changes are well-scoped and limited to session routing logic. The new `groupSessionScope` config is optional with a sensible default (`group`), and legacy `topicSessionMode` is correctly mapped. The switch statement covers all enum values with a default fallback. The Zod schema, JSON schema, and runtime logic are all consistent. No existing behavior changes unless the new config is explicitly set.
- No files require special attention.
<sub>Last reviewed commit: 6fd4a0d</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19793: feat(feishu): reply-in-thread, parallel group sessions, and fire-an...
by yinsn · 2026-02-18
77.0%
#10309: fix: use group ID for peer.id in Feishu group messages
by ParsifalC · 2026-02-06
75.1%
#20078: feat(session): Add channelGroups config(optional config) for shared...
by demarlik01 · 2026-02-18
74.5%
#7868: Default DM sessions to per-channel scope (avoid webchat contention)
by Smile232323 · 2026-02-03
73.9%
#10407: fix(feishu): Remove incorrect oc_ prefix assumption in resolveFeish...
by Bermudarat · 2026-02-06
73.4%
#10513: feat(feishu): add quota optimization flags
by BigUncle · 2026-02-06
72.7%
#21484: fix(feishu): scope message deduplication by accountId to support mu...
by guanyu-zhang · 2026-02-20
72.2%
#19254: fix(feishu): honor wildcard group config for reply policy
by WaynePika · 2026-02-17
71.9%
#14674: feat(feishu): add feishu_chat tool for chat info/member queries
by liuweifly · 2026-02-12
71.8%
#9253: Fix: Feishu chat ID mismatch causing session context confusion
by vishaltandale00 · 2026-02-05
70.8%