Skip to content

fix(benchmark): isolate trial usage sender policy - #6018

Merged
huangruiteng merged 2 commits into
mainfrom
codex/benchmark-runtime-isolation-20261009
Oct 9, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/benchmark-runtime-isolation-20261009

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Repeated LoopX CLI calls can start a detached usage-statistics sender. Benchmark installation/control commands and Codex shell tools did not share an explicit opt-out policy, so inherited environment filtering could leave that sender enabled during research trials.

New trials set LOOPX_USAGE_PING=0 in the shared runtime environment and Codex shell policy for every worker profile, including controls. Install/worker receipts disclose the configured setting. Product defaults, task scoring and feedback rules remain unchanged; existing trial configuration stays pinned. This reduces avoidable detached work and complements the container provider’s child reaping.

Validation:

  • Linux source-qualified shared-runtime/SForge tests: 213 passed. Host run: 35 passed, 178 skipped because optional runners are unavailable there.
  • Real staged Codex binary in Docker, using a synthetic Responses server: the generated production configuration overrides inherited LOOPX_USAGE_PING=1, and the actual shell tool returns 0; best-only hook delivery on the next model request and session resume still passes. No paid model call or benchmark task was launched.
  • Python syntax, diff whitespace and added-line public/private scans passed.

The real-tool probe establishes configuration adoption, not model decision quality or measured throughput. The related refactor pass reused the existing shared environment/configuration builders; a separate policy owner or new switch is unnecessary.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@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.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=xhigh.

独立评审范围:#6018,head 868f90ddb187f8ce3c94997d93f479d9a4c32b1d,base 20dd1a361db78d8a6d5178fd18c68044d3fcb932。当前登录账号与 PR 作者相同,因此以下 APPROVE 结论以 COMMENTED review 留存,不是 GitHub 的正式自批准,也不代表合并。

动机

执行研究试验、反复调用 LoopX 命令的操作者和 Codex 工作线程会遇到此问题。
旧版安装、控制命令和 Codex 工具没有统一关闭后台统计;同一个真实工具在继承值为 1 时仍读到 1,新版读到 0,避免后续 LoopX 调用启动这一路无用后台工作。
新建试验自动使用一致的关闭策略,覆盖五种执行模式的控制与工作环境,并在真实 Codex 工具中生效;操作者不必逐条补充环境参数。
本 PR 不改变产品统计默认值、评分、反馈或权限,也不修复容器的所有子进程回收问题;已有试验配置保持不可变。
真实长期试验的吞吐、成本和分数收益尚未测量,完整原生 judge 路径也未由本次评审验收。

这里的“后台统计”是 LoopX CLI 可能脱离当前命令启动的使用统计发送器。独立检查现有 loopx/usage_ping.py::begin:显式 0 会在读取统计状态和请求后台发送前返回;合成状态下,继承 1 会到达一次发送请求,0 则没有请求。该探针截获发送接口,未产生真实发送或网络流量。贡献是消除一种反复调用可重复触发的额外工作,不能据此把历史试验失败都归因于统计发送器。

规格依据为改动前已存在的 benchmark/runtime/RUNTIME.md,固定版本 20dd1a361db78d8a6d5178fd18c68044d3fcb932;没有把本 PR 新增 README 文案当作独立验收标准。按原文标题逐项核验:

  • Configure the native job:五种模式的执行、LoopX 技能有无和原生会话语义保留;新配置与不可变基线逐项比较,仅新增 shell 环境策略。
  • Install and isolate:使用试验内固定配置、避免操作者环境串入;真实 Docker 环境在预设 LOOPX_USAGE_PING=1 时覆盖为 0,产品目录和 source staging 未变。
  • Migration and qualification:旧试验不被改写,新配置必须进入新试验;五种模式旧 home 均拒绝设置变化,配置与会话内容原样保留;同一新版本重复准备仍保留历史。合成验证不冒充科学结果。

检索到的既有 repository-experience 建议涉及恢复 RFC 的首个用户旅程,当前修补的是已有研究 runtime 的环境策略,其领域和验收不相同,本次判为无关;没有将建议投递当成经验效用证明。

改动思路

安装、控制和模型工具共用现有研究 runtime,环境策略应在现有配置构造处统一设置,不能依赖每个调用者记住参数。
当前 PR 只为新建研究试验关闭统计发送器,并记录配置策略;保留既有试验的配置固定、会话历史、评分和产品权限边界。

真实路径是 BenchmarkCodex._profile_env → 安装/doctor/控制命令与 _worker_env → SForge 的环境传输;另一条路径是 prepare_codex_home → 固定 config.toml → 真实 Codex 的 shell 工具。进程环境和 Codex 过滤后的工具环境是两个实际边界,单独修一条会漏掉另一条。既有产品 native_codex_profile 已有同类关闭方式,但研究对照模式不能为了读取这条策略而安装完整产品 profile;沿用最近的研究构造入口更合适。

这是原有 Python 研究 provider 的局部修补,没有引入第二套 TypeScript 控制面决策、配置开关、调度机制或新的能力页面。未来维护检查未发现需要伴随抽象或迁移的重复状态规则;两个环境序列化出口保留,各自覆盖实际消费者。

具体改动

七个文件,+47/-10,已读完整 diff:

  • benchmark/runtime/codex.py::prepare_codex_home 在生成配置时加入 [shell_environment_policy.set] 与 LOOPX_USAGE_PING = "0"。已有配置字节比较先于写入,设置改变即报错;同版本重复调用保留会话,配置权限仍为 0444。
  • benchmark/runtime/harbor.py::BenchmarkCodex._profile_env 添加同一环境值,覆盖安装、doctor、控制及工作环境;安装 receipt 新增 loopx_usage_ping_enabled: false。
  • benchmark/runtime/sforge.py::SForgeWorker._install_worker 给工作 profile receipt 添加同一字段。official/single 分支已有调用共享 Codex 配置入口;其他分支已有调用共享 runtime,未增加安装产品的对照污染。
  • benchmark/tests/test_shared_codex_runtime.py 对五种模式验证生成配置,并扩展安装 receipt/命令环境检查;benchmark/tests/test_sforge_runtime.py 扩展工作 receipt 检查。
  • benchmark/tests/test_edgebench_feedback_docker.py 把真实 Codex 测试接到生产配置构造器,显式继承 1,要求实际工具输出 0;原有 best-only 反馈进入下一请求与会话 resume 的检查仍通过。
  • benchmark/edgebench/README.md 明确新试验默认改变、所有 profile 范围、旧试验固定及 receipt 仅记录配置。export_report.py 的现有读取检查不要求此新字段,旧 receipt 不会被补写或解释成已关闭的实际运行证明。

独立验证使用该精确版本源文件,Linux Python 3.12、Docker 29.5.2 arm64,复用缓存镜像,不启动付费模型或 benchmark task:

  1. python -m pytest -q benchmark/tests/test_shared_codex_runtime.py benchmark/tests/test_sforge_runtime.py:213 passed,9.56 秒,无跳过。
  2. 真实 Docker 的 RecordingDockerBackend → SForgeEnvironment.exec:五模式 × 控制/工作环境,共十条路径,在 UID 1000 下均将继承 1 覆盖为 0,测试容器均已移除。
  3. 真实 staged Codex + 合成 Responses 服务:test_codex_hook_enters_next_model_request_and_resume,1 passed,27.72 秒;实际 exec_command 输出 LOCAL_TOOL_OK__LOOPX_USAGE_PING__=0,下一请求反馈与 resume 保留。
  4. 回归敏感性反例:保持上述测试及环境不变,仅换成不可变基线的配置构造器,同一工具输出 LOCAL_TOOL_OK__LOOPX_USAGE_PING__=1,在关闭策略断言处失败(1 failed,16.30 秒);这是预期的反例失败,不是 head 的失败。
  5. 五模式新旧配置/环境逐项比较、旧 home 拒绝改写与新 home 重试保留会话、产品统计代码/评分与 launcher 字节不变;六个 Python 文件编译、diff whitespace、公开/私有增量扫描通过,两个提交均有 DCO。

保留失败边界:独立环境传输探针曾因评审脚本 shell 引号错误产生 NameError,修正仅该私有探针后十条真实传输全部通过,先前错误未算成产品故障。作者报告的完整 Docker 模块 native judge 失败涉及外部 JudgeCapacityExceeded 接口;独立诊断当前安装 provider 也缺该符号,但与作者原探针的显式 provider pin 不同,不能称为同命令基线复现。本 PR 的 judge 调用文件未变,本次没有启动该 judge,也没有声称完整模块全绿。按当前策略没有查询、等待 CI。

对主干的风险

默认变化限定在新建研究试验:关闭统计发送器是实际生效的环境设置,不是“建议”。产品默认、Goal、quota、scheduler、权限和评分均未改。它没有防止任务脚本自行改环境的安全权限,也没有授权任何账户或网络操作。receipt 中的 false 是配置投影,不是证明某个历史 solver 已采用、更不是 throughput 或 score 证明。

最需要防的反例是“只改父进程环境,工具过滤后仍启动统计”以及“升级准备时覆盖旧试验历史”。前者已由真实 Codex 的基线失败/head 成功覆盖;后者五模式逐项拒绝并保留原字节。配置变化需要新试验是已有正确性要求,不能为省步骤直接重写运行中 home。回退使用原 runner/config 建立新的试验;继续旧试验仍使用原 pin。任意镜像、长时间压力、真实 judge 全流程、科学分数/吞吐收益未测。

我的整体评价

APPROVE,无已验证阻塞项。这个有界增量有正向价值:同样的试验入口,无需额外参数就能避免一种随 CLI 次数增加的后台发送请求;五模式保持一致,重试不丢历史,对长程稳定性和操作效率有合理的正向预期。已经证明的是配置进入实际工具和控制边界,尚未证明的是实际长期吞吐或分数增益。下一步由研究操作者在新建、固定版本的匹配试验中观察累计成本;已有试验保持原样,不为该观察增设产品控制面。

English verdict: APPROVE - head 868f90d. The existing shared research builders disable the usage sender across setup/control and real Codex tools without rewriting pinned trials or changing product/scoring policy. Independently rerun 213 tests, ten real Docker environment paths and the real Codex hook/resume test; the identical test fails with immutable base configuration. Long-run throughput, score gains and the full native judge path remain unqualified. No merge performed.

@huangruiteng
huangruiteng merged commit 58699be into main Oct 9, 2026
7 checks passed
@huangruiteng
huangruiteng deleted the codex/benchmark-runtime-isolation-20261009 branch October 9, 2026 09:56
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.

2 participants