← Back to PRs

#17798: feat(feishu): support sender/topic-scoped group session routing

by yfge open 2026-02-16 06:01 View on GitHub →
channel: feishu size: S
## 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