refactor(lark): 删大厅 bot 互教打卡,改由平台 bot @ 一次教 union - #991
Open
deepcoldy wants to merge 1 commit into
Open
Conversation
大厅「bot 互教 union_id」机制(每 5min 轮询 + 点名打卡 + #hall-echo 回执) 不收敛且会刷屏:被 @ 的目标若 daemon 版本旧/scope 不足就永远学不到自己 union,触发反复点名;roster 落后时还会 @ 已退团的幽灵成员。改由平台 bot 在 新 bot 入大厅时主动 @ 一次来教(平台侧另一 MR),本 PR 删 daemon 侧整套互教。 删除: - dashboard.ts:maybeAnnounceHallPresence 编排 + 5min 定时器 + team-sync 触发 + 节流状态(HALL_ANNOUNCE_* / hall-announce-state.json 读写)+ readBotCrossRef - dashboard-ipc-server.ts:/api/platform/hall-announce 端点(唯一调用方是上面的编排) - event-dispatcher.ts:大厅分支里的 #hall-echo 回执互教 + hallEchoReplied 防环 set - i18n:platform.hall_announce 文案(zh/en,已无引用) 保留(关键,新方案的落点): - event-dispatcher.ts:recordBotUnionIdFromMentions(从任意 @ 自己的 mention 学 union)+ recordBotUnionId(自家消息回声)——平台 bot @ 新 bot 后,目标正是靠 这条通用自学链路学到 union。 - 大厅「吞掉 bot 消息不路由」的 swallow + return:平台 bot @ 新 bot 那条消息也 进大厅,其他 bot 收到必须继续吞掉,否则会当任务拉起会话。 不动 tunnel 协议(team-sync 消息本身保留,只是不再触发打卡)。⚠️ 部署顺序:本 PR 必须在平台侧「@ 一次」MR 上线之后再部署,否则中间窗口新 bot 无人教 union。 测试:pnpm build 通过;platform-team-store 7/7、platform-team-trust 10/10、 event-dispatcher 300/300、bot-talk-parity 18/18、team-roster 12/12、 team-group 7/7 全绿。无测试引用被删机制。 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
机器人大厅的「bot 互教 union_id」机制(每 5min 轮询 + 点名打卡 +
#hall-echo回执)不收敛且会刷屏:改由平台 bot 在新 bot 入大厅时主动 @ 一次来教 union(平台侧另一 MR)。本 PR 删 daemon 侧整套互教。
为什么平台 @ 一次能替代
/bot/v3/info不返回、contact 对 bot open_id 返回空、members 列表 bot 条目不带 union)。<at>即可 @ 到目标 → 目标从 mentions 学到 union。责任从对等 bot 互教收归到唯一的平台 bot,一次性事件驱动,不刷屏。删除
dashboard.ts:maybeAnnounceHallPresence编排 + 5min 定时器 + team-sync 触发 + 节流状态(HALL_ANNOUNCE_*/hall-announce-state.json读写)+readBotCrossRefdashboard-ipc-server.ts:/api/platform/hall-announce端点(唯一调用方是上面的编排)event-dispatcher.ts:大厅分支里的#hall-echo回执互教 +hallEchoReplied防环 seti18n:platform.hall_announce文案(zh/en,已无引用)保留(关键,新方案的落点)
recordBotUnionIdFromMentions(从任意 @ 自己的 mention 学 union)+recordBotUnionId(自家消息回声)——平台 bot @ 新 bot 后,目标正是靠这条通用自学链路学到 union。不动 tunnel 协议(
team-sync消息本身保留,只是不再触发打卡)。本 PR 必须在平台侧「@ 一次」MR 上线之后再部署,否则中间窗口新 bot 无人教 union。
测试
pnpm build通过🤖 Generated with Claude Code