Skip to content

Isolate native fixture startup from phase timeout assertions - #8877

Merged
loopx-agent merged 1 commit into
mainfrom
codex/test-phase-timeout-startup-20261117
Nov 16, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/test-phase-timeout-startup-20261117

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

The phase-budget fixture could time out before a cold native interpreter wrote its identity marker. That makes the independent communication-timeout test exercise startup instead, and its cleanup assertion can lose the actual child PID.

This proposal reuses only the existing test fixture from PR #8791 at d42379e94bf1fa278511543f33f8c21d865e3385. It observes the owned child handle for cleanup and waits for the synthetic worker to be ready before the independent timeout assertion. The communication deadline remains 0.4 seconds, and missing session identity is still rejected. No production runtime, Stop-hook behavior, execution authority, or scoring changes are included.

Validation on this commit:

  • All 21 phase-budget tests passed.
  • With a controlled 0.6-second synthetic startup delay, the original fixture failed and this fixture passed with the same 0.4-second communication deadline and unchanged outcome assertions.
  • Public boundary scan, all 5 direct premerge checks, and all 6 selected canaries passed. Premerge retains its explicit benchmark-sensitive maintainer review hold; this PR requires independent review before merge.

This removes a reproduced test prerequisite for the 2.4.0 source preparation. It does not certify the complete release test suite, native Windows, installed host adoption, or model effectiveness. The broader Stop-hook proposal remains with #8791.

Reuse only the phase-budget test fixture from PR #8791 at d42379e. Preserve the 0.4-second communication deadline and missing-identity rejection, and verify cleanup against the actual owned child before a synthetic PID file exists. The Stop-hook runtime changes remain with the original proposal.

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.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

未发现阻断本切片的 finding,批准本精确 head 的前置提案。 审查 head e825ac1dc3a1c9c8855bb482aa35c650098d9551,对比基线 f15ebdd16b5eb8cd01b2d112a3a0fe866b0f3486;结论不等于最终发行批准。

动机 / Motivation

维护 phase-budget 回归测试的开发者,需要检验独立通信超时,而不被解释器冷启动抢先打断。 旧夹具在原生进程启动超过 0.4 秒时会先缺失会话身份,清理断言也可能拿不到子进程 PID;本次先等合成 worker 就绪,再检验原来的通信超时,并由父进程记录实际子进程。 同一 0.6 秒启动延迟下旧夹具失败、新夹具通过,两边实际 communicate timeout 均为 0.4 秒;新夹具还能在子进程写标记前验证回收,身份缺失仍被拒绝。 本审查只覆盖现有测试夹具修复,不交付 Stop-hook runtime,也不运行评分、真实模型或发行。 完整发行全量测试和 #8791 的独立部署兼容性仍由各自原流程处理,本测试修复不替代它们。

改动思路 / Approach

启动就绪与通信超时分属测试准备和被测行为;只改既有夹具,实际时钟、身份核验和进程回收继续由原 runtime owner 执行。 当前 PR 的边界是修复已有测试的前置观测,不携带 #8791 的 Stop-hook 运行时代码。 完整 phase-budget 模块 21 项通过;延迟启动后仍按 .4 秒通信超时返回 unknown、非 retryable,未误报 phase 完成。 不修改会留下可复现的身份歧义或夹具误报;放宽超时或引入新的运行时分支都不是必要修复。实际实现复用既有 owner,错误继续由原校验和恢复路径处理,未新增用户确认、权限或自动外部动作。

具体改动 / Changes

关键代码讲解

  • _phase_worker 在原 child_process 上加观测,只写入实际 Popen PID;原 context manager 的 finally 仍负责真实回收。
  • _assert_reaped 优先使用父进程记录,CLI 子进程场景保留原 pid 回退。断言仍以 os.kill(pid, 0) 抛 ProcessLookupError 为准,没有把文件存在当成清理成功。
  • test_independent_earlier_timeout_stays_unknown 等待合成进程的 native-ready,限时五秒,进程提前退出或始终不就绪仍使测试失败。进入实际 communicate 后,限额仍为 0.4 秒;timed_out、非 budget_exhausted、unknown 和 retryable=false 的原断言全部保留。

验收依据为 benchmark/runtime/RUNTIME.md,spec_revision f15ebdd16b5eb8cd01b2d112a3a0fe866b0f3486。本次映射 original-phase-budget 与 owned-process-cleanup 均通过实际 worker/子进程验证。完整差异只有这一现有测试文件、+32/−1;Git blob 与 #8791d42379e 的该文件完全一致,其他运行时文件未带入。

我未参与这两个提案或原 #8791 夹具的实现;本次从独立 checkout 重新执行证据,不从共享 GitHub 登录推断 Agent 身份。

对主干的风险 / Risks

这个五秒等待仅是合成测试准备,不能当作生产启动获得额外预算。独立探针执行真实 worker 和 Popen:延迟 0.6 秒时旧测试拒绝缺失会话身份,新测试通过,两次实测 communicate 都收到 0.4;另用 0.05 秒阶段与 2 秒启动延迟,head 在 native pid 标记不存在时确认实际 owned child 已被回收,并保留身份缺失拒绝。完整模块 21 项通过。首次 premerge 缺 npm TypeScript 依赖,修复新 checkout 环境后,五项直接检查与六项选择检查均通过;benchmark_sensitive 人工门仍存在。

语义与 CI 对齐

复用既有版本/时钟合同,没有新增共享语义词汇。PASS 表示本地实际检查;未查询、轮询或等待托管 CI。保留所有失败、跳过与未测边界,未放宽硬限额、断言或人工门。

我的整体评价 / Verdict

本切片是 justified_increment:启动就绪与通信超时分属测试准备和被测行为;只改既有夹具,实际时钟、身份核验和进程回收继续由原 runtime owner 执行。 当前 PR 的边界是修复已有测试的前置观测,不携带 #8791 的 Stop-hook 运行时代码。 long_horizon 保持,未宣称模型效果或完整成本改善;user_experience 保持生产路径,改善维护测试的诊断可靠性。Inspected complete test-only diff and unchanged worker CLI: no rendered presentation changes. 未验证范围:No new UI qualification; complete release UI/Windows/model qualification is outside this prerequisite. 完整发行全量测试和 #8791 的独立部署兼容性仍由各自原流程处理,本测试修复不替代它们。 本次仅发布评审,不执行合并或发行。

English verdict: APPROVE at e825ac1. The existing fixture separates startup from the unchanged 0.4-second communication wait and preserves identity refusal and actual child cleanup; 21 tests and local checks pass. Final release qualification remains separate.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

已核对独立精确头评审和当前主干组合,准备合并本测试夹具修复。

  • 审查头:e825ac1dc3a1c9c8855bb482aa35c650098d9551;独立评审确认未参与本提案及原夹具实现,并验证 600ms 启动延迟下旧失败、新通过,两边通信限额均为 400ms,身份缺失拒绝及实际子进程回收保留。
  • 当前主干 4d4ea894155aa998509af04289193ffef829d9a9 的合成树只改这一个既有测试文件;生产 benchmark/runtime 子树与受测源码完全一致,无冲突,不带入 Stop-hook runtime。
  • 本轮完整 phase-budget 模块 21 项通过。启用既有质量策略的标准 premerge:5 项直接检查和 6 项选择检查全部通过,精确范围质量凭据有效。
  • premerge 总体仍为 manual_review_required,保留 benchmark_sensitive 人工门。该门由本次独立精确头评审及已有维护者合并授权处理;不修改门禁结果、不放宽预算、不启动评分或真实模型任务。
  • 当前 approval closeout clear、readiness ready,零未解决讨论。托管 CI 按既有配置未查询或等待。GitHub 同账号策略需授权的 admin bypass;独立 Agent 评审并非正式 GitHub self-approval。

这只交付测试夹具修复;完整 2.4.0 整合源码、全量测试与正式发行资格继续由原发布流程完成。

@loopx-agent
loopx-agent merged commit 7057c18 into main Nov 16, 2026
23 of 33 checks passed
@loopx-agent
loopx-agent deleted the codex/test-phase-timeout-startup-20261117 branch November 16, 2026 19:26
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