Repository navigation
fix: 修复多副本会话恢复空壳与延迟 - #2084
fix: 修复多副本会话恢复空壳与延迟#2084
Conversation
Co-authored-by: TRAE CLI <[email protected]>
Co-authored-by: TRAE CLI <[email protected]>
|
Additional provider-exit BOE E2E passed on exact head
This exceptional-path latency includes materializing a fresh control provider and authoritatively deleting the orphan compute; it did not reintroduce the 5-second multi-replica claim/reconcile retry. The previously reported normal close remains 2.223 s. |
Co-authored-by: TRAE CLI <[email protected]>
Co-authored-by: TRAE CLI <[email protected]>
|
Upstream-sync closeout:
|
|
自动评审初步意见(最终以维护者审阅为准) 我把分支 rebase 到最新 master(c5e544e6c,仅 test/event-dispatcher.test.ts 一处冲突,已按你 21162b4 里的同处解法合并;rebase 后树与 GitHub merge-tree 落地树逐字相同),构建与 8 个受影响测试文件(694 用例)+ 相邻 7 文件(191 用例)均通过。生产逻辑未发现 P1:pre/post canonical commit 两段 provider-exit 处理、retire 后由 fresh control provider 权威 close、generation/ready/稳定门禁、pending 卡失败降级与 outbox 终态收敛,时序上都成立。 有 4 处「PR 声称的行为,但没有测试能咬死」,我做了变异验证(删掉/改掉该逻辑后测试全绿),建议补测试后再合:
另外几个 P3 仅供参考:close 的 reconcile 保持即时对账(不走进 45s 等待)没有测试钉住;pending 卡 ACK 与 outbox 终态更新理论上存在顺序竞争(按实测时延实际不可达,记录即可);standby 在 owner 持续忙碌时可能每 100ms 重复 prefix 探测(有界、lease 过期自愈)。 总体:机制设计成立,以上均为测试补强,不动生产逻辑。 |
|
复审结论:可以合并。 0 P1 / 4 P2 / 4 P3。4 个 P2 均经变异验证为「新行为缺少测试咬合」,不涉及生产代码缺陷,不阻塞本次合并;建议另开 PR 补测试,按以下优先级:
P3(无阻塞,记录):close 的 reconcile 不进入 readiness 长等待缺一条行为钉;pending 卡 ACK 与 outbox 终态更新的理论顺序竞争;standby 在 owner 持续忙碌时可能按短间隔重复 prefix 探测(有界、租约过期自愈);pendingCardBeforeAck 展示层校验无直接用例(失败安全降级)。 已核对:构建(tsc / mock typecheck / dashboard / dist audit)通过;受影响与相邻 12 个测试文件 700+ 用例通过并多次连跑无抖动;影响面限于多副本 durable primary 的 remote-runner 控制路径,适配器未动,i18n 中英对齐。 更新(2026-10-22):上述 4 项已在本 PR 内补齐(commit 0a64029),不再另开 PR。增量已在最新代码上逐项变异复核,删回原逻辑对应新用例均变红:
增量复审(2026-10-22,head 281d7fe / 增量 commit 0a64029):四项 P2 全部闭合,六枪变异(prepare requestId 守卫、exit 清除门控、750ms 门禁、host readiness、dispatch 错误分类、consumer 100ms 快重投)逐条打红;增量生产改动另含一道 remote-runner 后端门控,经验证对 mojo 的 preparing 闸门有真实区分意义。结论:0 P1 / 0 P2 / 4 P3,可合并,无返工。CI 同 SHA 重跑 10/10 全绿(首跑唯一红腿 turn-terminal-receipt 为上游 #2056 引入的 20ms 时序 flake,该文件与 master 逐字相同)。新增 P3:remote-runner 门控本身尚无用例看守,建议 followup 补「mojo 的 preparing 闸门不因 provider 退出被清」。 |
Co-authored-by: TRAE CLI <[email protected]>
Co-authored-by: TRAE CLI <[email protected]>
…-readiness Co-authored-by: TRAE CLI <[email protected]>
…-readiness Co-authored-by: TRAE CLI <[email protected]>
remote-runner 专属的退出清闸门逻辑带后端门控:mojo 的 preparing/uncertain 关闭裁决必须保留以供 durable journal 对账。补两条用例钉住该门控, 删门控(对所有 remote backend 清闸门)即变红。 Co-Authored-By: Claude Code <[email protected]>
Co-authored-by: TRAE CLI <[email protected]>
…-readiness Co-authored-by: TRAE CLI <[email protected]>
…eadiness Co-Authored-By: Claude Code <[email protected]>
|
感谢贡献!已 squash 合入 master( 这个 PR 系统性地收口了多副本 PostgreSQL primary 模式下 remote-runner 关闭/恢复链路的三个问题:关闭/恢复即时反馈卡、provider 在 canonical commit 前后退出两种时序的对账与回滚、resume readiness 的观察+稳定门禁,以及可信 bot 后续可跟进项均为不阻塞的测试/观测小项(close reconcile 不走长等待的行为钉、standby 短间隔探测、pendingCardBeforeAck 展示层用例),不影响本次合入。 |
按双审 G7 合前对齐:并入 33aef3d(含 deepcoldy#2094/deepcoldy#2089/deepcoldy#2084/deepcoldy#2165/deepcoldy#2157)。 与 PR 同区为 src/bot-registry.ts、src/daemon.ts,git 自动合并无冲突; src/im/lark/identity-cache.ts 沿用上一次合并的解法(完整保留 deepcoldy#2082 函数体, 仅 JSDoc 首行为新措辞)。最终树相对 33aef3d 恰好 20 个 PR 文件、零夹带: tsc 0、13 个同区测试文件 1132 项全绿、bun run build 绿。 Co-Authored-By: Claude Code <[email protected]>
|
🚀 Released in v3.50.0 |
背景
多副本 PostgreSQL primary 模式下,Remote Runner close/resume 存在三个串联问题:
remote_runner_close_reconciliation_required;/close时,canonical routing context 遗漏 durable control queue,命令退回副本本地 close 并被 primary 防分叉门禁拒绝。修复
uncertain。queuePostAdmissionControl;既有allowedUsers/ daemon command 授权仍先执行,未知 bot、未授权 bot、self echo 和/close wt继续 fail closed。验证
/close被primary本地关闭门禁拒绝。bun run build通过(含 tsc、scripts/test-mocks typecheck、dashboard bundle 和 dist audit)。/closeE2E 等待内部受管 fork/Host 候选发布后执行。