Repository navigation
fix(collaboration): narrow nullable recovery reservations - #6980
loopx-agent merged 1 commit into
Conversation
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max
动机
维护者在验证控制面变更时遇到完整类型检查失败。首次恢复没有预留记录时,旧条件不能让编译器排除空值,导致七处类型错误;新条件先确认记录存在,完整检查恢复通过。精确候选的完整类型检查、既有恢复流程及同输入比较均已通过。本PR只修复既有恢复分支的空值判断,不新增重试机制,不证明真实模型或线上恢复性能。
改动思路
在既有判断处明确记录存在即可,避免第二套恢复规则、断言或新配置;底层读写与展示都无需改动。本次仅交付空值收窄和恢复兼容验证,不重写恢复策略、存储或界面。请求仍从原外部会话扫描器进入同一 TypeScript 规划器,由原 Python IO owner 验证来源并预留确定的 client identity,再交给 canonical Chat 队列。已有失败 Turn、重试退避及返回记录均继续由原 owner 管理。
具体改动
关键代码讲解
- planContextRecovery:第499行在读取 routing_attempt/version 及采用已有入队 Turn 前确认 previous !== null。它仍核对原 session、消息、origin、client identity 和附件;不能把另一个任务当作崩溃前已经入队的任务。
- planRoutingRecovery:第563行只在真实存在的旧 reservation 与当前失败 Turn 对应、且没有 routing_attempt 时保留旧迁移路径;首次恢复仍进入既有来源、时间、次数和 native 证据判断。没有增加任何重试或模型工作。
按既有规范 docs/development/testing-and-quality.md,spec_revision 4e6baa5,criterion_id local-validation-environment 已落实:完整 TypeScript 编译范围没有缩小,严格检查从七处 TS18047 失败变为通过。两个表达式之外没有源码变化,提交保留 DCO。与实际 PR base 对应的恢复模块及导入图已核;不可变6da基线与该base只有README双语文件差异。
对主干的风险
未发现阻挡性问题。主要风险是首次恢复被误拒绝,或崩溃后的已入队任务被重新执行。实际执行42项原生TS测试、74项隔离 Chat/store/queue/scanner/transport 测试,覆盖 project/steward、预留前后崩溃、再次失败与重启、原失败字节和原通知保持、来源编辑/撤销及未知副作用拒绝。另以同一30组输入比较不可变base与本head,完整结果相等且输入未改变。完整类型检查及premerge四项direct、十项selected均通过,无skip或advisory。预览曾出现的历史maintainability提示在实际执行中未再出现,不当作通过依据。
这里只修复已有判断,不增加可选开关、字段、权限、启发式分类或强制人类确认;普通请求、来源范围与恢复次数仍保持。未改PostgreSQL实现或存储语义。本地真实运行时使用合成模型/传输观测;它证明队列与恢复接线,不认证真实账号、线上模型或安装后的性能。依当前 wait_for_ci=false,未查询、轮询或等待CI。
我的整体评价
APPROVE,精确head af00738。long_horizon preserved:已有任务身份、原始失败记录及有界后继恢复保留;user_experience preserved:无新增设置、导航或确认轮次。该修改复用既有词汇与TS owner,代码量和维护成本相称;两处直接收窄已是更小的解法,没有合理必要再抽象或进行旁支重构。编译缺陷已独立复现并在候选消除,合法恢复语义有成对及持久化验证。尚未核验的真实provider与安装性能不在这项修复的交付主张内。评审批准仍与严格CQR、精确head readiness和既有合并授权分开。
English verdict: APPROVE — af00738. Two explicit null checks restore strict control-plane compilation without changing the observed recovery policy. 42 TS tests, 74 native runtime tests, 30 paired cases and the selected local premerge checks pass. Live-provider and installed performance are outside this compile repair; CI was not consulted under the resolved policy.
The control-plane typecheck fails with seven TS18047 diagnostics in conversation recovery because comparing
previous?.failed_turn_idwith a value from an open JSON record does not establish that the reservation exists. Both recovery branches now requireprevious !== nullbefore reading reservation fields.This changes two conditions in the existing conversation binding owner. Existing recovery identity, admission, backoff and retry limits remain in the same owner.
Validation on
af00738263059cbab89278aa8b23fceff3653109against main4e6baa51afdc2ad522012c1f691ae166c9d67e7b:tsc --project tsconfig.control-plane.json --noEmit: passes; the unchanged base produces the seven original diagnostics with the same compiler.Normal managed-runtime and installed validation remain unavailable under the local IPC restriction. This proposal does not close the separate return-delivery performance qualification.