Repository navigation
fix(windows): recover interrupted Codex CLI child publication - #7909
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Recovery-store publication src/codex/cli-update-job-store-windows.ts |
The recovery store can write during publication and adopt an existing pending file. The adopted file is flushed before rename, and the published record is read back. |
Pending-child validation and reconciliation src/codex/cli-update-recovery.ts, structure/codex-cli-update.md, docs-site/src/content/docs/reference/cli/agents.md |
Windows recovery can publish a pending child record when its identity matches the armed record and the parent, child lifetime, guardian proof, and Job checks pass. Failed or incomplete checks keep admission blocked. |
Recovery integration tests tests/codex-integration/codex-cli-update-windows-pending.test.ts, scripts/test-layout/layout-codex-collision.json, tests/fixtures/test-layout-expected.json |
Windows-gated integration tests cover successful reconciliation, invalid records and evidence, publication failures, and live child or Job states. The test is added to the integration layout mappings. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant WindowsAdmission
participant inspectRecoveryFiles
participant NativeEvidence
participant WindowsCliRecoveryIo
WindowsAdmission->>inspectRecoveryFiles: inspect recovery files with publishChild callback
inspectRecoveryFiles->>NativeEvidence: check parent, child lifetime, guardian proof, and Job state
NativeEvidence-->>inspectRecoveryFiles: return evidence
inspectRecoveryFiles->>WindowsCliRecoveryIo: publish validated child record
WindowsCliRecoveryIo-->>inspectRecoveryFiles: return publication result
inspectRecoveryFiles-->>WindowsAdmission: return reconciled or blocked status
Possibly related issues
- Issue 2811: This PR adds Windows restart recovery for interrupted CLI update child-record publication, which is part of the requested update apply workflow. It does not implement the full workflow.
Suggested reviewers: ingwannu, luvs01
Merge Risk: 
Minimal · up to e7191
-
No actionable regression was established. The reported Windows launcher failure still needs a native rerun.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files. (4 skipped: 4 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Verification
origin/dev12c0ec6edbcb002fdd25882db0add10c4e657573;bun install --frozen-lockfilepassed with Bun 1.4.4 on Windows x64.OCX_TEST_NO_QUEUE=1 bun test tests/codex-integration/codex-cli-update-windows-pending.test.ts ./.tmp/release-recovery/retained-replay.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts— 60 pass / 0 fail (30 pending cases, 1 private retained-byte replay, 29 layout checks). Includes pending file-identity preservation and native PID/FILETIME overflow refusal.OCX_TEST_NO_QUEUE=1, onebun testprocess per file discovered byrg -l 'cli-update' tests -g '*.test.ts'— 32 files, 871 pass / 92 existing skips / 1 fail. Windows recovery 12/0, Windows apply 31/0, existing recovery 61/0, native Job store 19/0. The sole failure isocx package launcher effective Bun runtime > uses a valid OPENCODEX_BUN_PATH for the actual proxy process: owned launcher/proxy remained at its bounded cleanup observation. Both owned PIDs were absent afterward. The test, launcher and process-control sources are unchanged. One isolated comparison at pristine base12c0ec6edbcb002fdd25882db0add10c4e657573, after frozen install, ranOCX_TEST_NO_QUEUE=1 bun test tests/cli/ocx-launcher-runtime.test.ts --test-name-pattern 'uses a valid OPENCODEX_BUN_PATH for the actual proxy process': exit 0, 1 pass / 0 fail / 90 filtered, 5.98 seconds. The base failure was not reproduced; this does not establish a green PR or prove the failure inherited. The PR-head failure remains unresolved and has not been rerun to green. The final focused run follows the two additional width guards; unchanged passing broad tests were not repeated.bun run typecheck,bun run structure:check,bun run privacy:scan,bun scripts/file-size-ratchet.ts, andgit diff --checkpassed. Docs frozen install andbun run buildpassed (593 pages, 85,235 internal links).e719164d4a94f512204bdba180c46fa2abb5c14apassed with zero blockers, including width guards. Agent review does not constitute maintainer security approval.test:changed(shared Windows host contention; the complete affected file set was run serially instead), native macOS/Linux/ARM64, release/promoted binary validation. Hosted PR checks are pending on this exact head; no workflow dispatch or CI rerun requested. PR remains draft for the retained local failure and maintainer security review.Checklist
Summary by CodeRabbit