Repository navigation
test(codex): stabilize one-shot cleanup during cold startup - #154683
Conversation
Control the completed/cancelled fixture clock and await turn acceptance so cold startup cannot exhaust the unrelated attempt deadline before cleanup assertions run. Production deadlines and cleanup assertions stay unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed September 21, 2026, 5:45 AM ET / 09:45 UTC. ClawSweeper reviewWhat this changesThe PR controls the cleanup test’s clock and waits for turn acceptance so cold startup does not exhaust its attempt deadline before cleanup assertions run. Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this remains a useful, focused fixture repair absent from current main. No introduced correctness defect was found; the stated repeated-run qualification remains unfinished. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s Codex plugin runs agent turns through an app-server client and records cleanup outcomes separately from completion or cancellation. These tests feed simulated server responses into that lifecycle and check terminal outcomes and cleanup warnings. flowchart LR
A[Test-controlled clock] --> B[One-shot attempt]
C[Simulated server replies] --> B
B --> D[Turn accepted]
D --> E[Complete or cancel]
E --> F[Terminal cleanup]
F --> G[Outcome and warning assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +14. Total +14 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep cleanup assertions synchronized to the attempt owner’s readiness signal while leaving production deadlines and cleanup semantics unchanged. Do we have a high-confidence way to reproduce the issue? Unclear for the exact historical CI failure: its shard replay passed. Source supports the timing-sensitive fixture mechanism, and the PR reports a controlled-contention baseline failure; this review did not execute it. Is this the best way to solve the issue? Yes. Controlling this fixture’s clock and using the existing turn-accepted event isolates cleanup behavior without increasing production timeouts or weakening assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 99e7d3e7a5b3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Control the completed/cancelled fixture clock and await turn acceptance so cold startup cannot exhaust the unrelated attempt deadline before cleanup assertions run. Production deadlines and cleanup assertions stay unchanged.
What Problem This Solves
Fixes: Codex one-shot cleanup tests fail during cold startup before they exercise the intended cleanup outcome. Related: #154393.
User Impact
User impact: no runtime behavior change. This keeps CI focused on cleanup receipts without changing production deadlines or weakening cleanup assertions.
Why This Change Was Made
The completed/cancelled fixture mixed a five-second real-time attempt budget with request polling and one event-loop turn as its readiness signal. Keep that table's clock under test control and wait for the existing
turn_acceptedevent. The shared teardown restores real timers before sibling cases. No tests, retries, higher timeouts, or production seams were added.The sibling native-process fixture has its own landed repair in 9247701; this PR addresses the remaining one-shot fixture.
Evidence
turn/start; the candidate passed all 19 cases across both affected files. Its completed case took 7.356s and still checked the same successful terminal outcome and uncertain-cleanup warning. Candidate wall: 51.764s. This proves load sensitivity; it does not establish the exact timing of the historical CI failure.pnpm test extensions/codex/src/app-server/run-attempt-one-shot-cleanup.test.ts --maxWorkers=1: 9/9 passed; 82.022s wall, 78.02s Vitest including cold transforms, 15.909s summed test cases. The original CI completed case failed after 5.683s. All 20 standalone runs passed 9/9 without retries; subsequent warm runs took 21.398–24.163s wall (median 21.945s).Repeated-run qualification complete: 20/20 standalone runs and 3/3 original-shard runs passed, including sibling coverage. The three shard runs comprise two local runs and hosted CI run 35584290125, job 106284238408, whose decoded ordered 12-file selection, Vitest config, and two-worker setting match the original shard. Its name changed from
changed-extensions-config-40tochanged-extensions-config-15; it passed 390/390 on its first observed attempt in 122.77s Vitest / 124.75s wrapper time. The nine one-shot cases totaled 9.828s, including 2.085s for the completed case and 0.290s for cancellation. The reviewed fixture bytes stayed unchanged throughout qualification. There is no claim of statistical flake elimination or a runtime cleanup fix.