Repository navigation
Recover Steward steering receipts after Chat restart - #9200
huangruiteng wants to merge 2 commits into
Conversation
Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
私有 Steward 操作者用已有重试动作确认一次已提交通道的纠偏。 原 live adapter 消失后,既有回执无法通过重试回到已交付。 用户在原 Codex Turn 接收纠偏后丢失 ACK。重新启动 Chat 并核查同一队列项时,当前主干一直保持交付未决,本提案只在原受管 store 的完整列表含有同一 Turn、输入 ID 和原文时交付一次。 同一入站身份由原队列回执延续,冷启动只读原生库存,同一个回执继续承载最终结果。 独立使用源码 HTTP 队列和合成 stdio;作者另录真实 app-server 跨进程运行。已安装 Desktop、实时飞书以及模型采纳未在本轮复验。
改动思路 / Approach
Python 原生适配器打开短命的只读 Codex 观察者。现有 TypeScript effect 判定匹配,现有 queue settlement 负责写回。 冷读限原受管 Codex store,重读当前 Session 核对绑定,沿用原先的权限与确证阈值。 复用已有持久化线程观察者和全量读取。仅扩展已保留输入的恢复入口,避免启动新的 Turn 或恢复原进程。
具体改动 / Changes
准确头 c1cde62,merge base a6ffb3b,3 个文件,+162/-24。将三个文件的准确头与 a6ffb3b 比较。b4e1ded37d4ecf1d43b788cf9d870d3e1020d3ab 已合入新提交,merge-tree 无冲突,原反例在该主干及其整合树上分别重跑。 按修订 1be3f3d 的现有规范核对各项要求。 目标规范
- exact-turn-ingress · Keep the original Session, Turn, input and ingress across retries.
- same-store-delivery · Only complete matching evidence from the original managed store may settle.
- single-settlement · Preserve one transcript event, original queue result and replay identity.
关键代码讲解
- 回执恢复 先绑定已有回执,冷读后重验 Session,再用类型化匹配确认。
- 原生观察者 复用短生命周期的初始化和清理;持久化 readback 只获取指定 Turn 的项目。
- 匹配判定 保留准确 Turn、入站 ID 与文本判定。
- 重启回归 区分丢 ACK、无证据、证据不符和恢复。
对主干的风险 / Risks
独立运行 5 项 Python steering 测试、41 项队列 HTTP 测试、9 项 TypeScript 状态测试和源码 quick premerge。丢回执用例关闭旧 native 进程再创建 ChatRuntime,在相同仓库脚本驱动的隔离 stdio 下读回原 Turn,重复调用得到同一条 delivered 回执。总计一次 Turn start、一次 steer 和一条 turn.steered 事件。 缺少持久化输入、文本不符或换到另一 Codex store 时,原队列预留保持 pending,FIFO 无法领取。复用同一丢回执断言,当前主干在返回原 store 后仍报 live_steering_delivery_unresolved,干净合并树通过。 精确源码和干净整合树上的冷读通过;同一冷读证明在未改主干失败。选择未改 UI 的既有 HTTP 路由覆盖回执与失败行为。 独立冷读验证使用合成 native 对端。真实推理中的纠偏消费与后续工作仍需分别观察。
我的整体评价 / Verdict
批准。当前准确头满足一次交付、同 Turn 和同 ingress 的 A23 要求。恢复结果继续由原队列动作读回。无证据时的保留行为有回归覆盖,后续真实推理中的纠偏采纳仍可按原生消费和实际工作结果单独验证。
English verdict: APPROVE at c1cde62. Approve this exact head. The cold read settles the original reservation only on matching complete evidence. The same restart witness fails on current main and passes on the clean merge tree. Wrong or missing evidence leaves the reservation intact.
Goal And Delivered Outcome
A private Steward correction can reach the original Codex Turn before its acknowledgement is lost. After Chat restarts, retrying the held queue operation now reads the original managed Codex store and settles the existing receipt when the complete native inventory confirms the same Turn, client message ID, and text. Missing or contradictory evidence leaves the original reservation pending.
This follows the private Steward steering delivery in #9185 and targets
main.Author Declaration
Implemented against
Turn-bound steering A23
The existing retry control now receives the same delivered receipt from a freshly started Chat backend. The cold reader shares the existing stdio client lifecycle for persisted native work.
Scope And Continuation
This change covers retries against the original managed Codex store and the existing private Steward queue admission. The packaged Composer continues to use its existing recovery control. Installed Desktop, live Feishu, and further model adoption evidence are separate end-to-end qualifications.
Validation
c1cde62c153cec6a495ae2000e01bc1c396a0587finishedsyntheticregression_paritypassedreal_entrypointpassedinitializeandthread/items/list. The entire run contained one native Turn start and one steering call. Inference used a local fixture.integrationpassedcomposer-session-admissionbrowser scenario passed. The browser scenario uses synthetic service responses for Composer recovery and queue behavior.staticpassedmanualnot_runValidation against current main
The candidate now includes main at
a6ffb3be6e7bdb48e02311ec58d618200fe0501c. The PR still changes the same three files. All six failing hosted browser jobs stopped on the same execution-observation assertion. The old target and the corresponding PR merge tree both reproduced that failure locally. The same check passes on the updated candidate, which includes the existing fix. Release job · Chat browser job · Main fix #9210The new wheel passed the isolated Codex app-server recovery check and the packaged Composer scenario. After the original native process exited, recovery returned HTTP 200 following the simulated lost acknowledgement and initial HTTP 409. The original Turn had one start and one steer, and the repeated request returned the same receipt. Three focused Python tests, nine typed steering tests, Ruff, standard premerge and the change-quality receipt passed. The prior baseline reproduction is recorded above.
Hosted checks and independent review are required for this commit. Installed Desktop and live Feishu remain separate qualifications.
Windows fixture dependency
The head-specific Windows PowerShell job failed on four captured research fixtures. The shared fixture used a socket selector on an anonymous subprocess pipe and raised WinError 10038. The fixture has identical contents on the tested base, the PR head, and main at
b4e1ded.On macOS, restricting the selector to socket behavior reproduced the four hosted failures on this exact head. Combining it with the shared fixture proposal in #9218 passed 20 tests under the same restriction. These covered the research fixtures, portable pipe behavior, and the original-turn and cold-restart steering paths. The combination was tested locally. The shared fix still requires review and hosted Windows qualification.
The independent review of
c1cde62approved the existing head. The Windows job remains failed for that head.Frontend / Visual Evidence
nonesyntheticType of Change
LoopX Area