Repository navigation
Restore Codex resume in benchmark workers - #9031
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
同一 Codex 会话连续执行 benchmark heartbeat 的调用者需要在下一次 wake 可靠恢复。共享命令构造器新增必填的每轮 MCP 环境参数后,无协作 MCP 的 worker 在启动 Codex 前就抛出 TypeError。候选把空环境交给共享构造器。真实 Codex CLI 在隔离的本地 provider 上完成两次唤醒并复用原会话,覆盖默认和显式 Complete 两条路径。评审范围是 worker 的进程启动、会话恢复和协作环境边界。
改动思路 / Approach
改动只在 benchmark worker 的既有 no-MCP 调用补齐共享构造器入参。构造器、会话所有者和绑定检查沿用原路径。一行运行时代码恢复入口,一条测试锁定带原会话的 resume 命令。使用相同 Python 依赖和隔离 workspace 配置对照 base 与候选,并用真实二进制向静态 loopback provider 发起请求。
具体改动 / Changes
精确 head 6873e924372bcd8edc19f30c6857b7369fbb9637,diff base 4a0188c1ca1b6e33a11a7e31ddb56315bc1cdd46,2 个文件 +14/-0。逐项复核 native-session-retention、no-mcp-route、recovery-context。验收约定
关键代码讲解
- 无会话的直接 exec 分支沿用原命令。持有会话的分支继续走共享构造器,并明确给出空的每轮 MCP 环境。源码
- 新增用例验证原 session ID 和 resume 参数,检查 argv 里没有协作 MCP 声明。源码
- 已用真实二进制与本地 Responses fixture 对照两个连续 wake,检查同一 session、delta 和 compaction 恢复。源码
对主干的风险 / Risks
两个真实 Codex CLI 用例在 base 都因参数缺失退出,候选均通过。配对 worker 套件从 105 通过提升到 129 通过,另有 72 跳过。两边在 File、SQLite 的显式私有文档扫描都触发相同诊断断言,来自本次变更以外的路径。另有六项现有 managed host 和 MCP 检查通过。
语义与 CI 对齐
原会话归属、外来会话拒绝和协作 MCP 作用域均有覆盖。真实模型得分、成本及已安装发行版仍待独立验收。
我的整体评价 / Verdict
批准当前提交。隔离运行中的默认与 Complete 续跑均沿用原会话,覆盖 context delta 和 compaction 恢复。共享 runtime 的受管入口仍可设置各自的 MCP 环境。
English verdict: APPROVE. Both real native worker continuation cases resume their original Codex session with loopback inference. The existing host binding and collaboration MCP scope remain protected.
Why
The native Codex benchmark worker calls the shared command builder when it owns a session. The builder now requires the per-Turn collaboration MCP environment. The benchmark call supplied no MCP server and omitted that parameter, so execution failed before Codex could start or resume.
Change
Pass an empty per-Turn environment for the worker's existing no-MCP configuration. A focused regression test checks the retained native session and the generated command.
Validation