Skip to content

fix: storage workers and CodeBuddy teardown on Windows after #5720 - #5721

Merged
lidge-jun merged 1 commit into
devfrom
codex/260924-dev-ci-windows-fixes
Sep 24, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/260924-dev-ci-windows-fixes

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

ci.yml lane=all on dev 0996ecb59b (run 35942446434) failed five Windows shards.

  • windows 1, 2, 7, 8/9: storage workers crashed. fix: close four regressions from the 260923 bundle round #5720 declared the Codex-state list in src/codex/home.ts as a module-level const below defaultCodexHome. The storage workers reach defaultCodexHome during module initialisation through an import cycle; with a ~/.codex directory 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 initialization in 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.
  • windows 3/9: CodeBuddy compiled-MCP teardown. afterEach removed its temp directory with rmSync while Windows still held the compiled ocx executable open (EBUSY). It now uses the shared removeTreeWithRetry helper 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 --noEmit clean.
  • Proof is a fresh ci.yml lane=all on the merged dev tip, per the owner's instruction to verify on dev after merging.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

#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.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 24, 2026 01:40
@lidge-jun
lidge-jun merged commit 560db33 into dev Sep 24, 2026
6 checks passed
@lidge-jun
lidge-jun deleted the codex/260924-dev-ci-windows-fixes branch September 24, 2026 01:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-24T01:42:53.823444Z d37cf03 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: fbed33d6-3902-4777-862c-a845556a7deb

📥 Commits

Reviewing files that changed from the base of the PR and between 0996ecb and d37cf03.

📒 Files selected for processing (2)
  • src/codex/home.ts
  • tests/providers/codebuddy-mcp-server.test.ts
 _________________________________________________________________
< You know what they call CodeRabbit in Paris? Royale with Debug. >
 -----------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant