Skip to content

feat(lark): 普通群回复支持按 bot 开话题#116

Open
xiongz-c wants to merge 5 commits into
deepcoldy:masterfrom
xiongz-c:codex/regular-group-thread-replies
Open

feat(lark): 普通群回复支持按 bot 开话题#116
xiongz-c wants to merge 5 commits into
deepcoldy:masterfrom
xiongz-c:codex/regular-group-thread-replies

Conversation

@xiongz-c
Copy link
Copy Markdown
Contributor

@xiongz-c xiongz-c commented Jun 4, 2026

背景

botmux 现在在飞书普通群里默认使用 chat-scope:顶层 @bot 消息会落到整群会话,回复也直接发在群里。这个模式适合“一个 bot 看整个群”的用法,但在任务型对话里容易把上下文摊到整群消息流里。

仓库已经支持通过 /t / /topic 在普通群里手动开话题。本 PR 把这个能力做成 per-bot 配置:开启后,普通群里新的顶层 @bot 消息会在原消息下开话题回复,后续发送和 history 都沿用现有 thread-scope 逻辑。

修改

  • 新增 regularGroupReplyInThread bot 配置,默认关闭,保持现有行为不变。
  • dispatcher 在普通群顶层消息上按接收 bot 自己的配置决定 chat-scope 或 thread-scope。
  • 话题群、真实话题和 p2p 路由保持原逻辑。
  • stale chat_mode 反查逻辑在确认当前是普通群后,也会按这个 bot 的配置选择是否继续 thread-scope。
  • Dashboard 的 Bot Defaults 页新增 per-bot 开关,并通过现有 card-prefs 通道保存到 bots.json、同步 daemon 内存。
  • 限制 autoStartOnNewTopic 仍只对真实话题群新话题生效,避免普通群开启“回复开话题”后未 @ 消息被误自动启动。

验证

  • pnpm test -- test/event-dispatcher.test.ts test/card-prefs-auto-start.test.ts test/bot-registry-grant.test.ts
  • pnpm build

@xiongz-c xiongz-c requested a review from deepcoldy as a code owner June 4, 2026 13:11
@xiongz-c xiongz-c changed the title Add per-bot thread replies for regular groups feat(lark): 普通群回复支持按 bot 开话题 Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant