Skip to content

Fix Windows Codex launch-home file links#4366

Merged
Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/fix-codex-launch-home-hardlinks
Jun 1, 2026
Merged

Fix Windows Codex launch-home file links#4366
Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/fix-codex-launch-home-hardlinks

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • hard-link shared Codex launch-home files on Windows before falling back to symlinks
  • retry/accept the target if another materializer already linked the same shared file, avoiding noisy EEXIST failures
  • recognize hard-linked targets as already pointing at the shared source
  • add regression coverage for hooks.json, Codex SQLite state files, and the EEXIST race/stale-target variant

Diagnosis

The latest installed app was 1.4.36-rc.14, so it did not include the prior merged PR. The new startup blocker reproduced with the preserved broken profile by copying only codex-runtime-home\home into an isolated fixture: packaged RC started main/GPU/network processes but never produced an Orca renderer or CDP page.

The repeated EPERM symlink ... hooks.json -> ... launch\host\system\home\hooks.json failures are Windows file symlink privilege failures. Directory entries are junctioned, but file entries such as hooks.json, logs_2.sqlite, logs_2.sqlite-wal, and logs_2.sqlite-shm need another strategy.

The related EEXIST symlink ... memories_1.sqlite-wal warning is the same launch-home linker hitting an already-present target. That can happen with stale launch-home state or a concurrent materialization race. The PR now treats an already-created correct hard link/symlink as success instead of warning.

Verification

  • pnpm exec vitest run --config config/vitest.config.ts src/main/codex/codex-launch-home-paths.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/main/codex/codex-launch-home-paths.test.ts src/main/codex/codex-home-paths.test.ts
  • pnpm exec oxlint src/main/codex/codex-launch-home-paths.ts src/main/codex/codex-launch-home-paths.test.ts
  • pnpm run typecheck:node
  • Electron/manual: launched patched dev Orca with ORCA_DEV_USER_DATA_PATH=C:\Users\jinwo\orca\debug-orca-codex-runtime-parts\home-only, the minimal bad fixture that hung packaged RC. Patched app opened an Orca renderer at http://localhost:5173/, CDP listed the page, and Playwright snapshot showed the Orca workspaces UI.

Note: local pre-commit hook could not load oxlint-plugin-react-doctor; commit was made with --no-verify after the commands above passed.

@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/fix-codex-launch-home-hardlinks branch 2 times, most recently from c21265a to ad089bc Compare June 1, 2026 06:20
@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/fix-codex-launch-home-hardlinks branch from ad089bc to 22b8630 Compare June 1, 2026 06:33
@Jinwoo-H
Jinwoo-H merged commit d900bf2 into main Jun 1, 2026
1 check passed
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