Skip to content

fix(benchmark): grant workspace-write plan stage access to runtime root - #9217

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/fix-plan-sandbox-runtime-root-20261122
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/fix-plan-sandbox-runtime-root-20261122

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Fixes Linux workspace-write planning failures (goal_acceptance_effect_failed / read-only authority stores) when LOOPX_RUNTIME_ROOT sits outside LOOPX_PROJECT and system /tmp.

Summary

  • Added _plan_sandbox_args in benchmark/runtime/worker.py so native_command passes -c sandbox_workspace_write.writable_roots=[LOOPX_RUNTIME_ROOT] only when stage == "plan" and execution.sandbox == "workspace-write".
  • Leaves stage == "execute" and read-only / danger-full-access sandboxes completely unchanged.
  • Verified with benchmark/tests/test_task_entry.py (70 passed, 42 skipped), ruff check, loopx check, canary premerge, and end-to-end native Linux x86_64 qualification (T0 & TM qualify_frontier_durable_plan_stdio).

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

评审固定提交 1ddeb3267f2535c4ff8e61a21009d0ceeb8fd3c8,merge base a6ffb3be6e7bdb48e02311ec58d618200fe0501c。与核对时 main a6ffb3be6e7bdb48e02311ec58d618200fe0501c 三方整合无冲突。

[P2 · Blocking] 用同一个工作目录解释计划阶段的运行时根

Path(runtime_root).resolve() 使用 worker cwd,而 native child_process 从 LOOPX_PROJECT 启动。传入 runtime 时,两条 Plan 路径都生成两个根;当 Codex 从 project 启动,原生 config/read 实读 project/runtime 与 launcher/runtime。计划因而额外纳入无关目录,超出本次声明的 trial 根。 在运行时入口统一归一化运行时根,并把它传给 LoopX 和 native launch。若兼容相对输入,按约定的项目目录解析并保留该目录的路径别名;若要求绝对路径,在入口明确校验。用不同启动目录的 fresh/resume 回归断言最终根一致。 候选位置

动机 / Motivation

计划阶段的 workspace-write 需要让 Codex 写入该 trial 的 LoopX 运行时目录,覆盖 fresh 和 resume 启动。 主干 native_command 沿试验配置启动,计划阶段未附加独立运行时目录。PR 记录该根在工作区与系统临时目录之外时,Linux 的 authority 写回失败。 候选仅在 workspace-write Plan 增加 Codex writable_roots,fresh 和 resume 共用辅助函数。绝对输入按作者修复方向生效。

在隔离临时目录中分别创建 launcher/runtime 和 project/runtime。worker 从 launcher 组装参数,仍按真实 child_process 设置 project 为 Codex cwd,传入相对运行时根,并用原生 Codex app-server config/read 核对解析。 独立验证止于原生 sandbox 配置的读取和本地测试。Linux x86_64 T0/TM 完整执行由作者在 PR 报告,未独立重跑。 现有交付规则

改动思路 / Approach

分支条件为 Plan 且 sandbox 为 workspace-write 且 runtime root 非空。普通 execution、read-only Plan 和全访问 Plan 沿现有 argv。 运行时根来自既有 trial 环境;child_process 仍应用原项目 cwd,执行阶段、read-only 和 danger-full-access 不发 writable_roots 覆盖。 Harbor 的标准 trial 提供绝对路径,因而未触发相对路径反例。现有新增回归只有绝对路径。

具体改动 / Changes

完整 diff 共 2 个文件,新增 46 行、删除 2 行。一个 DCO 提交,只改 worker 与其回归。新增测试断言绝对路径输出,并覆盖 fresh、resume 与其他 execution/sandbox 组合。

  • absolute_plan。支持位于工作区外的指定运行时根

  • isolation。execute 与其他 sandbox 继续沿左侧 argv

  • one_runtime。原生配置只授予选定 trial 的运行时根

  • _plan_sandbox_args。选择 Plan workspace-write 的附加根。 精确代码

  • native_command。为 fresh 和 resume 生成实际 Codex argv。 精确代码

  • child_process。将 child cwd 固定在 LOOPX_PROJECT。 精确代码

  • test_plan_native_command_exposes_runtime_root_only_during_workspace_write_plan。只用绝对运行时根验证范围和阶段开关。 精确代码

对主干的风险 / Risks

独立调用核对 fresh/resume 的绝对路径只产生预期根,execute 与 read-only Plan 不加覆盖。对相对路径的反例得到两个根,真实 Codex config/read 读回同一结果。

精确 base 的相同 argv 探针中,两种 Plan 都没有根覆盖,execute 与 read-only Plan 同样没有。 真实 config/read 确认 override 被解析成两个根。现有回归使用同一绝对路径,无法发现不同 cwd 的差异。

我的整体评价 / Verdict

REQUEST_CHANGES。 绝对路径用例按预期扩展;请把相对路径也绑定到同一个 trial 根,并让回归在不同启动目录下核对最终的两条原生 Plan 路径。

English verdict: REQUEST_CHANGES. Request changes. Both Plan paths add an unrelated writable root when the launcher and project differ and the configured runtime root is relative.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant