fix: storage workers and CodeBuddy teardown on Windows after #5720 - #5721
Conversation
#5720 declared the Codex-state list as a module-level const below defaultCodexHome. The storage workers reach defaultCodexHome during module initialisation through an import cycle, and with a ~/.codex directory present (every Windows CI runner, and most user machines) the call read the const before it was initialised: ReferenceError in the trash-restore and policy-run workers. The list is now local to the function. The CodeBuddy compiled-MCP test also removes its temp directory with the shared retrying helper: Windows keeps the compiled ocx executable locked briefly after the process exits, and a plain rmSync failed with EBUSY.
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. |
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary
ci.yml lane=allon dev0996ecb59b(run 35942446434) failed five Windows shards.src/codex/home.tsas a module-level const belowdefaultCodexHome. The storage workers reachdefaultCodexHomeduring module initialisation through an import cycle; with a~/.codexdirectory present (every Windows runner, and most user machines) the call read the const inside its temporal dead zone:ReferenceError: Cannot access 'LOCAL_CODEX_STATE' before initializationin the trash-restore and policy-run workers. The list is now local to the function. Linux shards passed only because their sandbox home has no~/.codex, so the check short-circuited first.afterEachremoved its temp directory withrmSyncwhile Windows still held the compiledocxexecutable open (EBUSY). It now uses the sharedremoveTreeWithRetryhelper like other fixture teardowns.Verification
bun test tests/codex-integration/codex-home-wsl.test.ts tests/codex-integration/codex-home-wsl-local-state.test.ts tests/storage: 170 pass / 0 fail;bun test tests/providers/codebuddy-mcp-server.test.ts: 5 pass;bun x tsc --noEmitclean.ci.yml lane=allon the merged dev tip, per the owner's instruction to verify on dev after merging.Checklist