Repository navigation
refactor(codex): remove WSL runtime mirror machinery - #16505
Conversation
Electron visible-behavior check (macOS, this PR app)Launched Visible: Codex System default is Active ( Gaps: Windows/WSL live UI, managed-account add/switch/remove, and a Codex pane launch were not available on this host. LandingAI Provider Accounts (Claude + Codex)Codex accounts (search-focused)Settings search “WSL” (no Account Location control)Agents: default = CodexStatus-bar Usage (Codex wk 13%)Manage Accounts… → accounts pane |
Review status: land after fixesReviewed the final PR state at
Remaining validation gap: live Windows/WSL managed-account flows and a Codex pane launch were not available on this macOS host. SSH and mobile surfaces are not touched by this diff. |
|
Remote Windows high-spec validation follow-up:
The existing local/macOS Electron screenshots and functional review remain valid; this is a platform-environment blocker, not a code finding. |
|
High-spec retry result (2026-08-26): I retried via the corrected remote-host and supervised orchestration paths, both against PR head The orchestration dispatch is recorded as failed ( |
740bef3 to
dc57877
Compare
cbfbd44 to
da2046a
Compare
dc57877 to
a327198
Compare
da2046a to
f1a1bbb
Compare
runtime-home-service.ts no longer spawns wsl.exe or imports child_process; both boundary guards fail closed on a stale entry so the goalpost keeps moving.
f1a1bbb to
42cbc0e
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughWSL runtime authentication drains now return promises and coalesce callers onto in-flight drains. Merge Risk: 🟡 Moderate · up to The refactor removes WSL mirror machinery but still leaves restart preservation skipping supported UNC-backed WSL accounts, which can leave refreshed authentication undrained after restart; the associated async test also may pass without confirming completion. Merge should wait for explicit owner follow-up on these bounded issues. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description summarizes the implementation and reports verification results, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing checkboxes, AI Disclosure, Review, boundary confirmation, Notes, and the Checklist. Resolution Complete the required template sections. Add the linked issue, explain the change and rationale, state N/A with a reason for Visual Proof if applicable, document manual and automated testing, complete the Agent skill upstream boundary section, address compatibility and platform impact, and complete the checklist.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d3e2cc74-f33a-4421-9348-23ca7f4487b4
📒 Files selected for processing (10)
src/main/agent-auth-restart-preservation.test.tssrc/main/agent-auth-restart-preservation.tssrc/main/codex-accounts/legacy-wsl-runtime-auth-drain.tssrc/main/codex-accounts/runtime-home-service.tssrc/main/codex-accounts/runtime-home-wsl-managed-accounts.test.tssrc/main/codex-accounts/runtime-home-wsl-session-bridge.test.tssrc/main/codex-accounts/runtime-home-wsl-system-default.test.tssrc/main/pty/codex-home-wsl-env.tssrc/main/wsl/__fixtures__/wsl-invocation-allowlist.txtsrc/shared/child-process/__fixtures__/child-process-import-allowlist.txt
💤 Files with no reviewable changes (3)
- src/main/wsl/fixtures/wsl-invocation-allowlist.txt
- src/shared/child-process/fixtures/child-process-import-allowlist.txt
- src/main/codex-accounts/runtime-home-wsl-system-default.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| syncActiveWslSelectionsBeforeRestart: vi.fn(async () => { | ||
| calls.push('codex-wsl') | ||
| }) | ||
| }, | ||
| store: { | ||
| flushPendingOrThrowAsync | ||
| flushPendingOrThrowAsync: vi.fn(async () => { | ||
| calls.push('flush') | ||
| }) | ||
| } | ||
| }) | ||
|
|
||
| expect(flushPendingOrThrowAsync).toHaveBeenCalledTimes(1) | ||
| expect(JSON.stringify(warn.mock.calls)).not.toContain('token-secret') | ||
| expect(calls).toEqual(['codex-host', 'codex-wsl', 'flush']) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the test wait for WSL drain completion.
The mock records codex-wsl before its promise settles. A non-awaited drain would still pass this assertion. Use a deferred promise and assert that flush does not run before the drain resolves.
| const account = this.getActiveAccount(settings.codexManagedAccounts, accountId) | ||
| if (!account || account.managedHomeRuntime !== 'wsl') { | ||
| continue | ||
| } | ||
| const distro = | ||
| selectedDistroKey === getWslSelectionKey(null) | ||
| ? account.wslDistro?.trim() || null | ||
| : selectedDistroKey.trim() || null | ||
| if (distro) { | ||
| drains.push(this.startLegacyWslAuthDrain({ runtime: 'wsl', wslDistro: distro })) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Drain UNC-backed WSL accounts too. Line 1043 skips accounts that getWslManagedHomePath(account) accepts without managedHomeRuntime === 'wsl'. Their direct-home launch works, but restart does not drain refreshed auth from a retained legacy pane. Classify these accounts with the same UNC-aware predicate and derive the default-lane distro from the UNC path when metadata is absent.
Electron QA (macOS, Playwright CDP)Fresh Orca dev instance launched from this worktree (
This PR is a WSL/backend change (remove Codex WSL runtime-home mirror machinery). No meaningful changed UI surface is reachable on macOS — What was exercised
The only visible “WSL” string on Accounts is unrelated OpenCode Go helper copy (“shared across Windows and WSL terminals”). Remaining gaps
Screenshots (full uncropped app window)Empty home (fresh profile): AI Provider Accounts (Claude + Codex; strongest relevant surface): Codex accounts section after scroll: Terminal settings (no WSL runtime UI on macOS): |
Electron QA (macOS, isolated dev instance)Launched a fresh electron-vite Orca from This PR is WSL/backend (runtime-home mirror removal). There is no dedicated changed UI. Closest reachable surface: Settings → AI Provider Accounts → Codex. On this macOS host the pane shows host System default / Active ( Not exercised: actual WSL launch/routing, mirror copy/read-back/seed, or restart preservation — those require Windows+WSL. Visible proofIsolated instance home (empty profile, app alive on this branch): Codex accounts / direct-home system default (closest related UI): Settings search |
Electron QA retry 2 (macOS, Grok + Playwright CDP)Launched a fresh Orca dev instance for Visible (this PR app):
Gaps (unchanged, platform): Windows/WSL live UI (Account Location, per-distro managed accounts, mirror-removal behavior) is not exercisable on this macOS host. A Codex pane launch was not run. An earlier concurrent launch of this worktree hit Landing (fresh instance)AI Provider Accounts (Claude + Codex, this device)Settings search “WSL” (no Account Location control)Agents: default = CodexStatus-bar Usage (Codex wk 24%)Manage Accounts… → accounts pane |
|
Codex review loop — status
PR is reviewed and ready for maintainer decision. Do not merge automatically. |
…tor(codex): remove WSL runtime mirror machinery" (#16722) This reverts commit ebcd637 (#16504) and dependent commit 673842d (#16505). Launch-blocker rationale (findings-counsel validated): - P0 Data Loss (F06-1): The WSL legacy auth drain deleteSource=1 path deletes intact source auth without re-validating the destination after concurrent destination rewrites, permanently corrupting auth credentials on upgrade. - P1 Workflow Regression (FC-01): Pre-upgrade sessions under ~/.local/share/orca/codex-runtime-home/home are not linked into direct homes, breaking /resume in the Codex CLI for upgrading WSL users.
* refactor(codex): remove WSL runtime mirror machinery * test(codex): drop allowlist entries the mirror removal made stale runtime-home-service.ts no longer spawns wsl.exe or imports child_process; both boundary guards fail closed on a stale entry so the goalpost keeps moving. * fix(codex): drain legacy WSL auth before restart * fix(codex): await WSL auth drain before restart (cherry picked from commit 673842d)
…tor(codex): remove WSL runtime mirror machinery" (stablyai#16722) This reverts commit ebcd637 (stablyai#16504) and dependent commit 673842d (stablyai#16505). Launch-blocker rationale (findings-counsel validated): - P0 Data Loss (F06-1): The WSL legacy auth drain deleteSource=1 path deletes intact source auth without re-validating the destination after concurrent destination rewrites, permanently corrupting auth credentials on upgrade. - P1 Workflow Regression (FC-01): Pre-upgrade sessions under ~/.local/share/orca/codex-runtime-home/home are not linked into direct homes, breaking /resume in the Codex CLI for upgrading WSL users. (cherry picked from commit 9c01e09)
* refactor(codex): remove WSL runtime mirror machinery * test(codex): drop allowlist entries the mirror removal made stale runtime-home-service.ts no longer spawns wsl.exe or imports child_process; both boundary guards fail closed on a stale entry so the goalpost keeps moving. * fix(codex): drain legacy WSL auth before restart * fix(codex): await WSL auth drain before restart
…tor(codex): remove WSL runtime mirror machinery" (stablyai#16722) This reverts commit 35c6098 (stablyai#16504) and dependent commit bf956ae (stablyai#16505). Launch-blocker rationale (findings-counsel validated): - P0 Data Loss (F06-1): The WSL legacy auth drain deleteSource=1 path deletes intact source auth without re-validating the destination after concurrent destination rewrites, permanently corrupting auth credentials on upgrade. - P1 Workflow Regression (FC-01): Pre-upgrade sessions under ~/.local/share/orca/codex-runtime-home/home are not linked into direct homes, breaking /resume in the Codex CLI for upgrading WSL users.




















Summary
Verification
src/main/codex,src/main/codex-accounts, andsrc/main/agent-hooks(12 skipped)pnpm typechecknode config/scripts/check-changed-code-quality.mjs