Repository navigation
fix: qualify observed Codex replay profiles and native validation - #7785
loopx-agent wants to merge 4 commits into
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
发现一项阻塞:[P2] 纳入工具失败保护后再资格化新版 native replay。在新增资格的 0.166.0-alpha.5.1 下,PostToolUse 的 tool_response 外层为 isError: true、内层含完整成功 reader JSON 时,真实 hook CLI 仍建立 candidate.native_resume,后续 SessionStart(resume) 保留 candidate。相同 fixture 的基线不为此 writer 建立见证;当前 head 却将失败工具结果纳入了新增资格。现有合同要求已知读取失败不能建立 baseline。已读取主干 62390312506d0087b4bd9433e59ef24c01ea6235 对 _context_pages 的外层失败保护,但它尚未包含在本 PR 的被测 head。请以包含该保护的新 head 重跑真实 hook CLI 的失败 wrapper 反例;不需要重复实现已落地的主干修复。
动机 / Motivation
已显式启用 native context delivery,并用新版 Codex 恢复会话的用户。旧版本不能为两个新 writer 建立 native replay 见证,需要走恢复路径;当前新增精确版本后,正常恢复已能继续,但工具结果外层已报告失败时,内层成功 JSON 仍可能被误当成可复用读入。当前正常 native 矩阵 16 项通过,独立 hook CLI 的关闭与损失控制也通过;外层工具失败反例仍失败,因此这个 head 尚不能完成新版 replay 资格验收。范围是已有 provider 的精确版本兼容和验证修复;不宣称完成 C1、提升默认配置、证明安装后的 App 使用、模型理解或长期收益。
改动思路 / Approach
writer 兼容仍归现有 Python IO 观察器,baseline 复用决定仍归现有 typed lifecycle owner,测试应读取实际公布的文件。本 PR 保留精确版本白名单与原有 IO/权限边界;完成资格前需要把已有的工具失败判定纳入被测 head,不需要新建 replay owner。将两个实际观察到的精确 writer 字符串加入已有 IO 兼容分支,比版本范围或新的状态 owner 更合适。读取 advertised 文件并核对 digest,也修复了测试仍打开已退役 delivery.json 的旧 oracle;测试专用目录遍历则需要同时保留已消失分支的容错与意外 IO 错误的可见性。
正常路径的价值已见于真实 exec、app-server、CodeMode 和合成 worker 入口:读取原始完整文件、接续 delta、进程 resume 和 compaction 后恢复。问题在于新增资格打开了依赖 _context_pages 的已知错误输入路径。正常矩阵通过不能替代“外层失败必须否决内层成功 JSON”的负例;关闭功能的隔离通过也不能解决开启后的资格缺口。
具体改动 / Changes
完整审阅 5 个文件,+82/-14,生产变化仅 +3/-1,其余是 capture/resume 与测试 runtime census。当前 head 4b0037065f25f7f0f2eca92767525e6e382c8993;本次按实际 merge base bc8658523968d2ff5c59d56afeb920fbe95f71ef 比较,未将 API 的后续目标状态 6e33f2c67e78f0548e9a3755a2f066fcf02bff5f 冒充相同基线。
已接受合同是 native context delivery 指南,固定 revision bc8658523968d2ff5c59d56afeb920fbe95f71ef。NATIVE-OFF:implemented,关闭时原 journal 字节不变;NATIVE-READ-LOSS:not_met,已知工具失败仍能为新增 writer 建立 resume 见证;NATIVE-CAPTURE:implemented,实际公布文件的字节、digest、target 及完整重建已检查。C1 的路线图边界仍要求后续消费者、结果与完整成本资格,本修复不承担整个父项完成。
关键代码讲解
-
_snapshot新增0.163.0-alpha.11.2和0.166.0-alpha.5.1两个精确 writer。物理绝对路径、文件归属/权限、metadata、记录边界和变化检测保留,未知后续版本不因前缀相近而自动获得资格。 -
codex_context_hook读取页、交给既有 typed lifecycle 更新,再由 IO 观察器附加 native replay 见证。新版本通过 metadata 分支后,正是沿这条真实路径受到外层失败漏判影响;版本字符串从来不是工作或权限授权。 -
_context_pages在本 head 的content分支只提取内层 JSON,没有否决外层isError。独立 probe 使用真实 hook CLI,传入外层失败和完整成功页,观察candidate.native_resume与 resume 后 candidate,复现了上面的阻塞。已读取主干的对应保护,没有声称已在本 PR head 上验证修复。 -
capture_disposable_effect_runtimes改用局部os.walk错误回调;仍排除借用目录、符号根和越界 locator。独立文件系统控制在本机对“目录消失”于 base/head 都能继续,因此作者的该项基线失败没有在本机复现;可确认的是 EIO 从旧路径静默吞掉变为当前抛出。既有真实 runtime 清理/身份控制也已执行。
| 同输入观察 | base | 当前 head |
|---|---|---|
| 真实 Codex 16-case capture/resume 矩阵 | 16 FAIL,保留旧 oracle/候选见证等原始失败 | 16 PASS,0 SKIP |
0.166.0-alpha.5.1,正常 reader |
无 native 见证,resume 后 candidate 移除 | 建立见证并保留,符合兼容修复目的 |
同版本,外层 isError: true + 内层完整成功 JSON |
无 native 见证,candidate 移除 | 仍建立见证并保留:FAIL |
原有 0.162.1 的相同错误 wrapper |
也能保留 | 仍能保留,作为既有错误的控制;新增版本扩大了资格范围 |
| 14 组 profile/loss、56 次实际 hook CLI | 与对应旧资格状态比较 | 常规控制 PASS;关闭返回值与 journal 字节保留 |
| replay 与清理控制、静态检查 | — | 109 PASS;Ruff、配置 mypy 17 文件、编译和语义检查 PASS |
| 标准 premerge | — | 6 项直接与 9 项目录检查 PASS;1 项既有维护性 advisory 仍 FAIL |
对主干的风险 / Risks
P2 的触发形状为 PostToolUse.tool_response = {"isError":true,"content":[{"type":"text","text":"<完整成功页 JSON>"}]}。在已读合同中,已知读取失败不能建立 baseline。当前新 writer 却能在这个实际 CLI 输入下得到 native_resume,后续 resume 保持原 epoch/candidate。不是将任意旧缺陷要求本 PR 重修:同一新增 writer 在基线没有该见证,本次资格扩展使它进入了这个已知失败路径。最小修复是纳入已有主干保护,并用同一失败 wrapper 加正常控制重验新 head;无需重做已落地修复或扩大到完整 C1。
正常 native 检查使用真实 Codex 0.166.0-alpha.5.1、真实 owning backend 和隔离 runtime;响应由固定 loopback 服务生成,没有外部模型推理、真实 benchmark 任务或全局安装。独立 profile 控制还区分了 native 见证与仍合法的 saved-file delta:文件缓存可重建,不等于模型保留。真实 binary 验证使用 Codex 0.166.0-alpha.5.1 和固定的本地响应;0.163.0-alpha.11.2 使用合成 writer 控制。未验证安装后的 App、真实模型保留/理解、净费用收益或完整 C1。
早期独立脚本曾因非物理临时路径、目录遍历注入器未转交 FD、错误假设基线也抛 EIO,以及 hook probe 漏带显式隔离路由而失败。记录均保留;修正的是 fixture/adapter,当前真实外层失败反例没有被改成通过。目录消失的作者历史原因继续保持未独立复现,不能从后来通过推断已解释。
维护性 ratchet 仍 FAIL:基线/当前相同命令的完整失败 SHA256 均为 9d88719f4a1548b47726f28ad226ff76e2ef1844c616d83f2ce46170a14838fe,不变 oracle/预算/报错模块和环境证据已核对,未降低门限。它与本次新发现分别记录:前者是已有债务,后者是必需负例的真实失败。CQR 已记录 fail 并保留阻塞,没有改写成通过。本轮未查询、轮询或等待 CI。
语义与 CI 对齐
默认关闭路径的实际配对控制保持隔离,没有新增 prompt、必填字段、设置或调度义务。writer 版本是 provider 的外部兼容输入,复用原有语义,不是新的角色生命周期或权限协议。当前违反的是既有读取失败监督合同;差异级词汇 advisory 和其他通过检查不能覆盖这个缺口,也不能把必须拒绝的失败称为建议。
我的整体评价 / Verdict
not_yet_proven 指当前新版 replay 的完整资格,不否定正常恢复和测试 oracle 修复的实际价值。长程连续性与用户体验当前均为 not_yet_proven:正常路径能继续,但错误工具结果仍可能被当成可复用见证;最小补齐是包含已有保护的新 head 及同一失败/正常 CLI 控制。普通使用没有新增确认轮次,问题是机器对失败状态的判断,不是要求用户多做配置或确认。
已检查 native hook/provider、原有 context-config 路由和测试修复;没有渲染呈现或布局改动,视觉评审不适用。真实 binary 验证使用 Codex 0.166.0-alpha.5.1 和固定的本地响应;0.163.0-alpha.11.2 使用合成 writer 控制。未验证安装后的 App、真实模型保留/理解、净费用收益或完整 C1。writer 兼容仍归现有 Python IO 观察器,baseline 复用决定仍归现有 typed lifecycle owner,测试应读取实际公布的文件。本 PR 保留精确版本白名单与原有 IO/权限边界;完成资格前需要把已有的工具失败判定纳入被测 head,不需要新建 replay owner。范围和代码量相称,局部兼容与测试修复可以保留;需要修复的是开启后的资格负例。C1 的默认输出成本、完整 reader 退出、真实采用与结果/完整费用继续是父项的独立未验证边界,不能由此 PR 的测试数量代替。
English verdict: REQUEST_CHANGES at 4b0037065f25f7f0f2eca92767525e6e382c8993. The newly qualified writer retains native replay after an enclosing failed tool result; include the existing decoder protection and revalidate the exact head.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
4b00370 to
37facf0
Compare
|
Resolved the P2 at exact head The branch now includes main's enclosing Validation: 278 passed, 46 explicit native-binary skips; focused matrix 14 passed; Ruff, diff check, semantic inventory advisory and public-boundary scan passed. The earlier broad attempt used an unintended Python missing |
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
当前完整 head 可以批准。原 P2 已通过同一真实 hook CLI 反例复核;没有把未知 CI、作者测试声明或旧 head 结论当成批准依据。
动机 / Motivation
已启用 native context delivery、用两个已观察 writer 格式恢复 Codex 会话的用户。旧路径遇到这两个 writer 时不能保留 native replay 见证;当前正常完整读取后可在同一会话 resume,而已报告失败、损失或未知格式仍退回原 capture 的恢复路径。新 head 的真实 hook CLI 配对控制与实际 Codex 验证支持这个兼容增量;它不证明真实模型保留、理解或成果/完整费用收益。不完成 C1、不改变开关默认、不验证安装版 App、不执行外部模型或 benchmark 实验。完整 C1 的最终输入、采用、成果和完整费用资格继续由既有父项承担;0.163.0-alpha.11.2 使用合成 writer 控制,实际 binary 验证为 0.166.0-alpha.5.1。
改动思路 / Approach
writer 识别与文件观察留在现有 Python provider IO;完整读取和 lifecycle 仍由既有 TypeScript owner 决定。无需新增状态、版本范围或第二个 replay 决策 owner。当前 PR 仅交付两个精确 writer 的兼容、advertised capture oracle 和 disposable runtime census 修复。不修改开关、安装或工作权限。已读现有 typed lifecycle、文件观察器和真实 caller;做更大的版本范围或独立 decoder 会扩大资格边界,维持原状则继续迫使正常新版会话恢复。当前小范围兼容是合理选择。
本轮将队列提供的经验用于核对第一项有用结果、既有 caller 和恢复后的后续工作,不以测试数量代替交付;这不证明经验本身带来可测收益。
原 review 发现的是“外层工具已失败,内层成功页仍被当作可复用证据”。当前 rebase 已包含主干的失败保护,故复审重点是实际执行这个负例,同时重验正常、未知版本、关闭和丢失历史,不能只确认上一条 finding 的文本已改。
具体改动 / Changes
完整审阅 5 文件,+136/-28,生产文件 +10/-11。精确 head 37facf0da9d9165e6683ae6a61dddb82120a1aa0,merge base da4510af61277c0d0786fa5aa040ccb01538b1cb。规格为 native context delivery 合同,固定 revision da4510af61277c0d0786fa5aa040ccb01538b1cb;以下是本次映射行名:NATIVE-RESUME、NATIVE-READ-LOSS、NATIVE-OFF 均 implemented,证据如下;C1-OUTCOME 为 out_of_scope,依据同 revision 的 C1 caller cutover 边界,不将父项未来资格加到本修复上。
关键代码讲解
_snapshot只增加0.163.0-alpha.11.2和0.166.0-alpha.5.1,仍检查物理绝对路径、regular file、归属/权限、metadata、session/model、inode 和观察中变化。相近的未知后续版本不因前缀而获资格;原有 append-only 记录集合未扩张。_context_pages保留主干已经落地的外层失败优先级,再交给既有 TypeScript lifecycle。外层isError: true或非零exit_code内即使含完整成功 JSON,也不能创建 native replay 见证。它是机器强制的读取完整性要求,不是提示。capture_disposable_effect_runtimes用局部 walk 错误处理继续扫描已消失分支,同时将意外目录 EIO 抛出。仍拒绝 symlink/越界 locator,最终 shutdown 继续经过原 authenticated owner、PID 和 frozen path 校验。这是测试 fixture,不是新的生产 runtime 权限。test_native_cli_capture_delta_and_compact_recovery直接读取 descriptor 公布的 path、核对 SHA/full recovery identity;full 的测试专用归一化没有重建已退役的重复文件,也没有替代独立字节、target 和输入观察 oracle。
| 同一 synthetic 输入、真实 hook CLI | base | 当前 head |
|---|---|---|
| 两个新增 writer,正常完整读取再 resume | 无 native 见证,candidate 不保留 | 见证成立,candidate 保留 |
| 外层 isError 或 exit 7 + 完整成功页 | 拒绝 | 拒绝;原 capture 恢复可用 |
| 原有 0.162.1 正常/未知下一版本 | 前者保留,后者无资格 | 相同 |
| 显式 off,已准备的同一 journal | 输出空对象,字节不变 | 相同 |
另在原 head 4b0037065f25f7f0f2eca92767525e6e382c8993 独立重跑两个新增 writer 的失败 wrapper:二者都会错误保留见证并 survive resume;同一输入在当前 head 均拒绝,说明本次证据能区分原缺陷。这里的 native 见证与仍可安全重建的 saved-file delta 不同;无见证不等于删除原文件,也不能据此宣称模型保留。
对主干的风险 / Risks
PASS:源 checkout 的 capture/resume/lifecycle/cleanup/boundary 模块 278 passed、70 个显式 native skips;另用实际 Codex 0.166.0-alpha.5.1 执行 22 个 native 用例全部通过,覆盖 exec、app-server、CodeMode、原生 resume、worker 历史替换/未知 profile、两次 compaction 后原 Turn 恢复与后续 synthetic 工作。binary 版本前后相同;响应由本地固定服务提供,没有外部模型请求。配对 CLI 控制在 base/head 各 12 种状态、每次 15 页,核对正常、两种失败 wrapper、未知版本和 off 字节;另外两个旧 head 反例确实暴露原错误。
Ruff、编译、配置 mypy 17 文件、diff、双语 diff 与 5 文件公开边界扫描通过。标准 premerge 的 6 项直接检查通过;10 项选中检查中 9 项通过、1 项为既有 maintainability advisory。该 advisory 的完整失败在固定 base/head 字节一致,均指向未改的 host_process_transport.run_host_process,无 magnitude regression。没有放宽预算或删掉失败断言。
LIMIT:本机 Python 3.14 的目录消失控制在 base/head 都通过,不能声称独立复现了作者早期 race 原因;可确认 EIO 由基线吞掉变为当前抛出,生存 locator 与 root symlink 控制通过。作者历史失败、未运行的其他 opt-in native 用例和安装/模型层边界继续保留。
HOLD:aggregate premerge 因当前 base 的 stale CQR receipt 退出 1,merge_gate_passed=false;不是完整 premerge 通过,也没有改写作者旧 receipt。它是后续合并资格,当前局部正确性有独立证据;本轮不合并、不 dismissal。CI 未查询、未轮询、未等待,状态/原因保持未知。
语义与 CI 对齐
新增值是 provider 外部 writer metadata,复用现有 typed lifecycle,不创造共享控制词汇或更广 actor/authority 合同。inventory advisory 未发现支持形式的新 carrier,这不是语义安全证明;实际完整性与关闭反例才支持本结论。_matches/_append_only 的局部布尔简化由旧版本和损失控制覆盖。当前主干已另行启用部分受支持 native 默认;本 PR 没有改这个默认,本次 off 隔离指显式关闭路径,不能把历史 base 的缺省 off 写成当前操作说明。
我的整体评价 / Verdict
这是 justified_increment:可用的新 writer 恢复、实际文件 oracle 和测试清理可独立交付/回退;完整 C1 继续开放。long_horizon 为 preserved:恢复后原 Turn/原 receipt 与后续 synthetic 工作保持,不由计数推断真实模型收益;user_experience 为 improved:合法正常 resume 少一次不必要的恢复,已知失败仍给原 capture 路径,没有新增确认轮次。检查了 native hook、CLI/context-config 和测试修复;没有渲染呈现或布局变化,视觉审查不适用。未验证安装版 App、实际 0.163 binary、真实模型保留/理解和 C1 成果/完整费用。
writer 识别与文件观察留在现有 Python provider IO;完整读取和 lifecycle 仍由既有 TypeScript owner 决定。无需新增状态、版本范围或第二个 replay 决策 owner。当前 PR 仅交付两个精确 writer 的兼容、advertised capture oracle 和 disposable runtime census 修复。保留现有兼容 owner 比新增框架更相称;已做的局部布尔整理可保留。原 P2 在新 head 经真实正反控制解决,完整五文件没有发现新的阻塞。批准不清除独立 review、当前 base 的 CQR 或 maintainer 合并门禁。
English verdict: APPROVE at 37facf0da9d9165e6683ae6a61dddb82120a1aa0. The original failed-tool replay defect is resolved and the bounded exact-writer compatibility is independently validated; CI remains unconsulted and merge qualification is separate.
Goal And Delivered Outcome
Current native qualification had three reproducible failures: the full-file oracle opened a retired duplicate after #7775; replay of exact observed Codex writer metadata
0.163.0-alpha.11.2/0.166.0-alpha.5.1lacked a resume witness; and test runtime retirement could remove a directory during locator traversal. This proposal fixes those existing caller paths.0.166.0-alpha.5.1: mainbc8658523failed all 16 on the obsolete file oracle; the fixture-only commit89d34dca2passed 10 and failed 6 resume cases; final4b0037065passed all 16. These earlier failures remain evidence.main, selected atbc8658523968d2ff5c59d56afeb920fbe95f71ef. Subsequent main changes through6e33f2c67touch three unrelated test files; no overlapping source changes.Author Declaration
bc8658523supply the compatibility boundary.codex_context_history._snapshottest_codex_context_capture.pydelivery.jsonmanaged_effect_runtime_fixture.pySelf-review keeps this as a provider compatibility edit and two directly demonstrated test repairs. The small traversal error callback owns the known-retirement versus unexpected-error boundary; no general abstraction or new decision owner is needed. The test-only full-wire normalization retains independent bytes/digest/target and model-input oracles. New record/event forms, future-version ranges and protocol relaxations are outside this proposal.
Scope And Continuation
Complete within this compatibility scope. Native context delivery remains opt-in and the existing CLI/native-host journey remains the caller; no new capability, configuration owner, frontend control or layout is introduced. No first-screen visual evidence is applicable. Packaged native/CLI readback is distinguished from installed App use and model comprehension.
The parent C1 work remains open in #7430: current-main integration, default plan-carrier duplication/output budget, complete reader exit and outcome/full-cost comparison still require their own evidence. This independently reversible repair does not depend on completing that larger wire change.
Validation
4b0037065f25f7f0f2eca92767525e6e382c8993; profile controls ran on identical blobs before the final commit.regression_paritypassedunitpassedunitpassedreal_entrypointpassedreal_entrypointpassedstaticpassedmanualpassed1b20a5b73f1172b3efcd19c97be2fa5c1da7a9bbbc60af7839c492477deee2d5; receiptcqr_1b20a5b73f1172b3efcdvalid, zero blockers; safe-fix allowed / unused (0 passes). The optional inherited failure below remains a failed observation with matched attribution.integrationpassed|
static|failed| Optional full-tree maintainability advisory: unchanged oversizedhost_process_transport.run_host_process. Independent clean immutable base6e33f2c67and head4b0037065runs both exit 1 with identical full diagnostics, fixture/environment digests and zero magnitude regression. Exact-diff maintainability passes; required checks are not waived. |Coverage limits: native transport/input-boundary behavior is exercised with the real binary and owning backend; inference is deterministic. No claim of autonomous adoption, retained model comprehension, solver benefit, installed App behavior or full C1 delivery. No PostgreSQL store, runtime authority, quota, scheduler, permissions or score semantics are changed. CI was neither queried nor manually triggered. Merge and live installation remain separate maintainer actions.
All commits are DCO-signed. No raw native histories, temporary evidence, generated bundle, credentials or local operating context is included.
Review Repair At
37facf0da9d9165e6683ae6a61dddb82120a1aa0The branch is rebased onto
da4510af61277c0d0786fa5aa040ccb01538b1cb, so the existing enclosing-tool-failure protection from main is now part of the tested head. A realquota context-hookCLI regression covers both newly qualified writer versions: an outerisError: truewrapper containing otherwise valid reader pages retires the candidate, does not createnative_resume, and SessionStart recovery keeps the candidate absent. Normal qualified replay and unknown-version fallback remain covered.Validation at the exact head: 278 passed, 46 explicit native-binary skips across native resume, lifecycle, capture and managed-runtime fixture modules; the focused failure/normal/version matrix passed 14/14; Ruff, diff check, semantic inventory advisory and public-boundary literal scan passed. The first broad run used an unintended system Python without
_sqlite3or nested pytest and is retained as environment-failure evidence; the declared Python 3.12 plustestextra run is the passing result. No live install, external model call or benchmark job was performed.