Repository navigation
fix(oncall): 外部 bot 首条 @ 前也先完成 defaultOncall 自动绑定 - #1765
Merged
deepcoldy merged 1 commit intoOct 9, 2026
Merged
Conversation
开了 defaultOncall 的 bot,群绑定是「首条被观察到的消息」时懒写入的。 原先只有人路径在 canTalk 前调用 ensureDefaultOncallBound;外部 bot 路径 (被 @ 的主路径 + 免 @ 新话题自动开工)直接 evaluateBotTalk,于是新拉的 告警群里若第一个开口的是外部告警 bot,oncallChats 里还没有该 chat → 判无权限 → 误弹授权申请卡(oncall 群对 bot 本应直接放行)。直到有真人 说话触发绑定后才恢复。 抽出 bindDefaultOncallBeforeTalk,人/bot 三处 talk 判定前统一调用。 绑定是 chat 维度策略、与 sender 无关,不新增任何放行来源。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
xu4wang
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
October 9, 2026 09:51
Owner
|
你好 @xu4wang,这个 PR 的评审群已经建好。由于你是飞书外部协作成员,系统无法直接把你拉进内部群,请通过下面的一年有效链接申请加入: 也可以在自动拉群名单文档里补录/更新你的飞书信息: 这是自动评审流程发出的消息,如有不便敬请谅解。 |
This was referenced Oct 9, 2026
|
🚀 Released in v3.39.0 |
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.
问题
开了 defaultOncall(Oncall 模式)的 bot,群的 oncall 绑定是在首条被观察到的消息时懒写入的(
ensureDefaultOncallBound)。人路径在
canTalk前会先调用它(注释里写明是为了防“oncall 群首条消息误弹授权卡”),但外部 bot 路径没有:evaluateBotTalkautoStartOnNewTopic):直接evaluateBotTalk所以新拉的群里,如果第一个开口的是外部 bot(典型场景:告警机器人 @ 运维 bot),
oncallChats里还没有该 chat → 判无权限 → 误弹授权申请卡。等真人说了话、触发绑定之后才恢复正常。线上实例(daemon 日志):
改法
bindDefaultOncallBeforeTalk绑定是 chat 维度的策略,与 sender 无关;不新增任何放行来源,
evaluateTalk/evaluateBotTalk不变。验证
handleThreadReply,不发授权卡test/event-dispatcher.test.ts、test/oncall-store.test.ts、test/bot-talk-parity.test.ts:514/514 通过tsc --noEmit(主工程 + test-mocks):通过update-check.test.ts,单独连跑 3 次 40/40 全过,判定为 flaky、与本改动无关🤖 Generated with Claude Code