Skip to content

fix(codex): launch WSL accounts from direct homes - #16504

Merged
brennanb2025 merged 7 commits into
mainfrom
brennanb2025/sta-4606-wsl-mirror-removal-stage-3
Aug 27, 2026
Merged

brennanb2025 merged 7 commits into
mainfrom
brennanb2025/sta-4606-wsl-mirror-removal-stage-3

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​475 $\color{#cf222e}{\Huge{\mathbf{−}}}$​110 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​365
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​566 $\color{#cf222e}{\Huge{\mathbf{−}}}$​38 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​528

Summary

  • launch Codex WSL sessions and quota reads from the selected account home, or the distro system home
  • preserve each running pane on its original launch home when account selection changes
  • drain fresher credentials from the retired WSL runtime home guest-side until legacy panes exit

Verification

  • full src/main/codex, src/main/codex-accounts, and src/main/agent-hooks suites
  • pnpm typecheck
  • node config/scripts/check-changed-code-quality.mjs
  • focused mutation checks for direct-home launch selection and freshness-gated promotion

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron UI validation (macOS, isolated profile)

Isolated Orca dev instance for this worktree. No product code changed.

Instance identity

  • CDP http://127.0.0.1:9336, renderer http://127.0.0.1:5177
  • Isolated profile: ORCA_DEV_USER_DATA_PATH temp dir
  • window.api.app.getIdentity(): name=Orca: brennanb2025/sta-4606-wsl-mirror-removal-stage-3, isDev=true, devLabel=sta-4606-stage-3-pr16504 @ brennanb2025/sta-4606-wsl-mirror-removal-stage-3, devRepoRoot=/Users/brennanbenson/orca/workspaces/orca/sta-4606-stage-3-pr16504
  • Dock tile: Orca/ brennanb2025-sta-4606-wsl-mirror-removal-stage-3

Visible evidence

Landing (empty isolated profile)
No workspaces. Status bar shows Codex quota 13% used 5d 23h plus Grok 53% used 2d.

01-landing-isolated-profile.png

Settings → AI Provider Accounts → Codex

  • Codex System default is Active, email [email protected]
  • Empty-state copy: “No managed Codex accounts for this device. Orca will use that environment's system default Codex login until you add one here.”
  • “Showing accounts for this device.”
  • No Account Location / WSL distro picker (macOS; wslSupportedPlatform is false)

03-accounts-codex-system-default.png

Settings search WSL
Filters to AI Provider Accounts, but the WSL Account Location control is not rendered. Confirms WSL account-home UI is not reachable on this Mac.

04-settings-search-wsl.png

Settings → Agents → Codex command override
“Codex home to import from” with host placeholder ~/.codex (WSL variant would be {distro}: ~/.codex).

05-agents-codex-home-import.png

Usage popover (quota from system Codex home)
Codex: Resets in 5d 23h, weekly 13%. Footer: Manage Accounts…. This is the host system-default home path, not a WSL managed-account home.

08-usage-rate-limits.png

Usage → Manage Accounts…
Deep-links back to AI Provider Accounts (same Codex system-default surface).

09-manage-accounts-from-usage.png

Backing IPC/store

{"accounts":[],"activeAccountId":null,"activeAccountIdsByRuntime":{"host":null,"wsl":{}},"systemDefault":{"hasAuth":true,"authKind":"oauth","email":"[email protected]"}}

Settings: localAccountRuntime=auto, localAccountWslDistro=null, localWindowsRuntimeDefault.kind=windows-host.

Residual gaps (not exercised)

  • WSL is not available on this macOS host. Could not switch Account Location to WSL, pick a distro, add a WSL managed Codex account, or launch a Codex pane from a WSL account home.
  • Isolated profile has no workspaces, so no live Codex PTY to check “preserve each running pane on its original launch home” or legacy WSL runtime-home drain.
  • Did not click Add Account (opens interactive codex login in a desktop browser).
  • Info tooltip “About importing Codex history” did not stay visible in screenshots (control itself is visible).

This validates the host system-default Codex account-home / quota UI on the PR worktree. Direct WSL launch-home behavior still needs a Windows/WSL host.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

PR review status

Status: PASS WITH RISK — land after CI completes.

Review completed on the PR worktree with the required readiness passes, focused performance/reliability review, and cross-platform checks.

  • Pushed focused fixes in 740bef3de79232b5d6a2156400648968334da4eb:
    • coalesced concurrent legacy WSL auth-drain triggers so rate-limit polling cannot build an unbounded promise chain while a retained pane is open;
    • validated selected WSL account homes against runtime/distro metadata and safely fall back to the distro system home for stale selections;
    • added regression coverage for drain coalescing.
  • Verification: pnpm test src/main/codex-accounts — 41 files / 282 tests passed; pnpm tc:node — passed; direct oxlint/oxfmt — passed; changed-code quality diagnostics — 0 findings.
  • Electron validation was run in an isolated PR worktree/profile with identity verified. Visible host Codex account, Agents home-import, Usage quota, and Manage Accounts surfaces were exercised. Screenshots and detailed evidence are attached in the Electron validation comment.
  • Remaining risk: this macOS environment cannot exercise the Windows/WSL-only account-location, direct-home launch, retained-pane preservation, or guest-side legacy drain paths. CI’s Windows/WSL checks remain required before merge.

No scope-expanding product changes were made.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status update — Windows high-spec validation

  • Same-model review loop is clean at 740bef3de79232b5d6a2156400648968334da4eb; the meaningful fixes are pushed in that commit.
  • Readiness checklist passed at both the start and end of this review session.
  • Automated verification remains green: src/main/codex-accounts tests (282 tests), pnpm tc:node, changed-code quality, oxlint, and oxfmt.
  • macOS Grok Electron validation passed for the reachable host Codex surfaces; screenshots are attached in the earlier evidence comment.
  • I also orchestrated a Grok validation attempt against the Windows high spec environment. The remote worktree was created, but the Windows runtime has no Grok executable and the worker could not establish a supported Electron/CDP session there before the run became blocked; no Windows/WSL screenshot evidence is being claimed.

The remaining gap is therefore environment/tooling coverage of the WSL-specific UI paths (distro/account-home selection, direct-home launch, pane retention, and legacy drain). No additional product changes were made while addressing this validation gap.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

CI note

The current GitHub run also has an unrelated flaky failure in src/main/ssh/ssh-remote-commands.test.ts (tests node 24 2/16); the failure is in the real-POSIX GC-output bounding test and is outside this PR’s Codex/WSL files. The verify job is red only because that shard failed. Local targeted tests and type/lint checks for this PR remain green; I did not broaden the change to “fix” an unrelated flaky SSH test.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Windows high-spec retry

Retried the orchestrated Grok/Electron validation after the runtime recovery. The Windows high-spec runtime is reachable, but the remote WSL environment still has no grok executable (only claude and codex), so worker-start --agent grok stalled with the task prompt being interpreted by the shell before any Electron/CDP session could start. No Windows/WSL screenshots are claimed; the WSL-specific UI coverage remains blocked by this environment limitation.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/sta-4606-wsl-mirror-removal-stage-2 branch from ebea84e to 14e33f5 Compare August 26, 2026 21:47
@brennanb2025
brennanb2025 force-pushed the brennanb2025/sta-4606-wsl-mirror-removal-stage-3 branch from 740bef3 to dc57877 Compare August 26, 2026 21:48
The apply script validated the source hash and then re-read it with cp, so a
legacy pane rotating in that window put bytes freshness never judged over a
valid account home. Codex rewrites auth.json in place, so that read can be torn.

Covers it by running the real guest script under sh with a sha256sum shim that
rotates the source between the two reads; without the guard it exits 0.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/sta-4606-wsl-mirror-removal-stage-3 branch from dc57877 to a327198 Compare August 27, 2026 00:03
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/sta-4606-wsl-mirror-removal-stage-2 to main August 27, 2026 00:03
@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change replaces shared WSL runtime-home materialization with direct managed or system homes. It adds a per-distro legacy authentication drain that validates, promotes, removes, and marks legacy auth. The drain now handles credential files and protects against torn reads. WSL auth reads run in one bounded guest process. WSL pane attribution now identifies legacy, account, direct-home, and shared-home routes. Tests cover drain outcomes, concurrent triggers, authentication rotation, direct-home launches, session bridging, refreshes, restarts, and account switching.

Merge Risk: 🟡 Moderate · up to fbf53

This PR redirects WSL sessions and quota reads to selected account homes or the distro system home while draining legacy credentials. Merge readiness remains moderate because cleanup can remove a recoverable credential prematurely, and stale host paths can cause credentials or sessions to use the wrong WSL home; owner follow-up is needed before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main changes and lists verification steps, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, AI Disclosure, Revi… Complete the required template sections. Add the issue reference after "Fixes #"; provide the required Visual Proof entry or state "N/A" with a reason; document testing platforms and check the applicable testing items; complete AI Disclosur…
Docstring Coverage ⚠️ Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: launching WSL accounts from direct homes. It is concise and related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the main changes and lists verification steps, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Complete the required template sections. Add the issue reference after "Fixes #"; provide the required Visual Proof entry or state "N/A" with a reason; document testing platforms and check the applicable testing items; complete AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. Expand the summary into explicit ELI5, What Changed, and Why sections.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 97c7c83d-eab2-4a57-a8d3-9476e23f12b8

📥 Commits

Reviewing files that changed from the base of the PR and between f6e16ba and a327198.

📒 Files selected for processing (11)
  • src/main/codex-accounts/legacy-wsl-runtime-auth-drain-apply-script.test.ts
  • src/main/codex-accounts/legacy-wsl-runtime-auth-drain.test.ts
  • src/main/codex-accounts/legacy-wsl-runtime-auth-drain.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-accounts/runtime-home-wsl-managed-accounts.test.ts
  • src/main/codex-accounts/runtime-home-wsl-session-bridge.test.ts
  • src/main/codex-accounts/runtime-home-wsl-system-default.test.ts
  • src/main/codex/codex-pane-account-registry.ts
  • src/main/codex/codex-pane-launch-account.test.ts
  • src/main/codex/codex-pane-launch-account.ts
  • src/main/codex/codex-stale-pane-accounts.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.

Comment on lines +249 to +254
if [ "$8" = 1 ]; then
[ "$(hash_file "$source_auth")" = "$5" ] || exit 40
rm -- "$source_auth"
printf '%s\n' '{"completed":true}' > "$temporary_marker"
chmod 600 "$temporary_marker"
mv -f -- "$temporary_marker" "$3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Synchronize destination auth before legacy cleanup.

When $7 is 0, the target hash is checked only at Line 226. If Codex then fails during an in-place target rewrite, Lines 250-254 remove the last complete auth file and prevent later recovery with the completion marker. Retain the legacy source until the destination writer uses atomic replacement or participates in a shared lock.

Comment on lines +1127 to +1156
const accounts = this.store.getSettings().codexManagedAccounts.filter((account) => {
const parsedHome = parseWslUncPath(account.managedHomePath)
return parsedHome?.distro.toLowerCase() === distro.toLowerCase()
})
const authReads = new Map<string, WslCodexAuthRead>()
for (const account of accounts) {
const parsedHome = parseWslUncPath(account.managedHomePath)
if (parsedHome) {
try {
authReads.set(account.id, await readWslCodexAuth(distro, parsedHome.linuxPath))
} catch {
authReads.set(account.id, { kind: 'unreadable' })
}
}
}
const match = this.findManagedAccountForRuntimeAuth(runtimeAuthContents, undefined, {
accounts,
authReads
})
if (match.kind === 'ambiguous') {
return null
}
if (match.kind === 'matched') {
const parsedHome = parseWslUncPath(match.account.managedHomePath)
if (!parsedHome || parsedHome.distro.toLowerCase() !== distro.toLowerCase()) {
return null
}
return {
authContents: match.managedAuthContents,
linuxHomePath: parsedHome.linuxPath

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify whether persisted/migrated WSL accounts can carry a Linux home separately
# from a UNC managedHomePath.
rg -n -C 4 'wslLinuxHomePath|managedHomeRuntime|managedHomePath' src

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- repository guidance ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- relevant symbols ---'
rg -n -C 3 --glob '*.ts' \
  'interface CodexManagedAccount|type CodexManagedAccount|wslLinuxHomePath|parseWslUncPath|resolveLegacyWslAuthDestination|getWslCodexHomePathForSelection' \
  src/main src/shared 2>/dev/null
printf '%s\n' '--- reviewed method ---'
sed -n '1040,1180p' src/main/codex-accounts/runtime-home-service.ts

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- runtime selection and destination code ---'
sed -n '1045,1168p' src/main/codex-accounts/runtime-home-service.ts
printf '%s\n' '--- production WSL account metadata usage ---'
rg -n --glob '!*.test.ts' --glob '!*.spec.ts' \
  'wslLinuxHomePath|managedHomeRuntime|wslDistro' src/main src/shared
printf '%s\n' '--- account type and applicable convention ---'
cat src/shared/managed-account-types.ts
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions/src.md

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- WSL account creation and persistence ---'
sed -n '810,865p' src/main/codex-accounts/service.ts
sed -n '1215,1275p' src/main/codex-accounts/service.ts
sed -n '1415,1440p' src/main/codex-accounts/service.ts
printf '%s\n' '--- WSL account fixtures with runtime markers ---'
rg -n -B 8 -A 12 --glob '*.test.ts' \
  "managedHomeRuntime: 'wsl'" src/main/codex-accounts
printf '%s\n' '--- relevant repository convention ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions/src.md

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- WSL runtime tests around legacy path handling ---'
sed -n '430,545p' src/main/codex-accounts/runtime-home-wsl-managed-accounts.test.ts
printf '%s\n' '--- all production construction sites for WSL managed homes ---'
rg -n -C 5 --glob '!*.test.ts' --glob '!*.spec.ts' \
  'managedHomePath:|managedHomeRuntime: .wsl.|wslLinuxHomePath =' \
  src/main/codex-accounts src/shared/managed-account-types.ts
printf '%s\n' '--- account normalization and migration references ---'
rg -n -C 4 --glob '!*.test.ts' --glob '!*.spec.ts' \
  'codexManagedAccounts|managedHomePath|wslLinuxHomePath' \
  src/main/store src/main/settings src/shared 2>/dev/null || true

Repository: stablyai/orca

Length of output: 24911


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- destination result and account matching ---'
sed -n '1123,1215p' src/main/codex-accounts/runtime-home-service.ts
rg -n -C 6 \
  'function findManagedAccountForRuntimeAuth|findManagedAccountForRuntimeAuth|function readWslCodexAuth|readWslCodexAuth|startLegacyWslRuntimeAuthDrain' \
  src/main/codex-accounts src/main

Repository: stablyai/orca

Length of output: 27663


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '32,112p' src/main/codex-accounts/legacy-wsl-runtime-auth-drain.ts

Repository: stablyai/orca

Length of output: 2761


Use WSL metadata for legacy destination resolution. getWslCodexHomePathForSelection accepts WSL accounts without a WSL UNC managedHomePath, but resolveLegacyWslAuthDestination excludes them before matching credentials. The drain then returns pending and does not promote refreshed credentials. Use wslDistro and wslLinuxHomePath.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 24db8012-f05a-41f1-bd09-b6fe803649db

📥 Commits

Reviewing files that changed from the base of the PR and between a327198 and fbf53dd.

📒 Files selected for processing (5)
  • src/main/codex-accounts/legacy-wsl-runtime-auth-drain-apply-script.test.ts
  • src/main/codex-accounts/legacy-wsl-runtime-auth-drain.test.ts
  • src/main/codex-accounts/legacy-wsl-runtime-auth-drain.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-accounts/wsl-codex-auth-batch-reader.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment on lines +256 to +267
source_credentials="$legacy_home/.credentials.json"
target_credentials="$target_home/.credentials.json"
if [ -f "$source_credentials" ] && [ ! -e "$target_credentials" ] && [ ! -L "$target_credentials" ]; then
[ "$9" != missing ] || exit 43
[ "$(hash_file "$source_credentials")" = "$9" ] || exit 43
cp -- "$source_credentials" "$temporary_credentials"
chmod 600 "$temporary_credentials"
[ "$(hash_file "$temporary_credentials")" = "$9" ] || exit 43
[ "$(hash_file "$source_credentials")" = "$9" ] || exit 43
mv -n -- "$temporary_credentials" "$target_credentials"
elif [ "$9" = missing ] && [ ! -e "$target_credentials" ] && [ ! -L "$target_credentials" ]; then
[ ! -e "$source_credentials" ] && [ ! -L "$source_credentials" ] || exit 43

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Remove verified legacy credentials before completion.

When the last pane exits, Line 289 removes only auth.json; .credentials.json remains after the marker is written. Verify $9 again during finalization, then remove the source credentials. If it changed, exit 43 and retry.

@OrcaWin

OrcaWin commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Windows Electron validation (HEAD fbf53ddee2f426542cbd2cf2e7a7378c69d1721d)

Native Windows 11 high-spec host awin (Intel Ultra 7 270K Plus, 32 GB) + WSL Ubuntu-24.04. Isolated Orca dev profile, CDP 9334, renderer 5174. App identity: Orca: OrcaWin/pr16504-windows-electron-final → this worktree.

A new WSL Codex pane on Ubuntu-24.04 resolved direct distro system home CODEX_HOME=/home/neil/.codex (and ORCA_CODEX_HOME the same). The live codex process (PID 776470, cwd /mnt/c/Users/neil/orca/workspaces/orca/pr16504-windows-electron-final) used that path. Retired ~/.local/share/orca/codex-runtime-home/home was not in the env; its home/ tree was last written 16:37, while ~/.codex was written 20:13 during this launch. Isolated profile had no WSL managed account, so the selected-account-home branch was not live-exercised.

Focused unit tests: 71 passed, 2 failed, 6 skipped (drain-apply-script skipped on Windows). Failures are Windows-host assertion issues, not the live WSL path.

1. WSL Ubuntu-24.04 context

01-wsl-context.png

2. Codex pane direct-home probe

02-codex-direct-home.png

3. Codex TUI after launch (same pane)

03-codex-tui.png

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

Completed the requested review session for STA-4606 stage 3 at fbf53ddee2f426542cbd2cf2e7a7378c69d1721d.

  • Same-model/high-thinking adversarial review ran for three rounds and finished clean.
  • Opening and closing readiness checklists both passed with no P0/P1/P2 findings.
  • Precedent and performance review found the approach aligned with established patterns and no remaining performance regression.
  • The review made three scoped fixes:
    • prevent torn MCP credential promotion;
    • batch WSL auth reads to remove account-scaled subprocess fanout;
    • prevent a destination auth.json overwrite race.
  • No stage-4 cleanup, redesign, or unrelated refactor was added.

Verification completed:

  • 79 focused tests passed.
  • 1,216 relevant tests passed.
  • pnpm tc:node passed.
  • Normal, type-aware, changed-code, and React Doctor lint checks passed.
  • Formatting and git diff --check passed.
  • Native Windows 11 + Ubuntu-24.04 WSL Electron validation passed via Playwright CDP with an isolated profile. A live Codex process showed both CODEX_HOME and ORCA_CODEX_HOME resolving to /home/neil/.codex, and the retired codex-runtime-home path was not used. Screenshots and detailed evidence: fix(codex): launch WSL accounts from direct homes #16504 (comment)

CI status:

Residual QA gap: the isolated Windows profile did not contain a managed WSL account, so the managed-account-home variant was not live exercised. The native WSL home path and launched Codex environment were exercised successfully.

The branch is clean, pushed, and matches the PR head SHA above.

@brennanb2025
brennanb2025 merged commit ebcd637 into main Aug 27, 2026
48 checks passed
rahuljangirworks pushed a commit to rahuljangirworks/veer that referenced this pull request Aug 27, 2026
* fix(codex): launch WSL accounts from direct homes

* fix(codex): coalesce WSL auth drains and validate distro homes

* fix(codex): preserve legacy WSL account home metadata

* fix(codex): retain marked WSL home compatibility

* fix(codex): verify the bytes the WSL drain promotes, not an earlier read

The apply script validated the source hash and then re-read it with cp, so a
legacy pane rotating in that window put bytes freshness never judged over a
valid account home. Codex rewrites auth.json in place, so that read can be torn.

Covers it by running the real guest script under sh with a sha256sum shim that
rotates the source between the two reads; without the guard it exits 0.

* fix(codex): harden WSL auth drain races
brennanb2025 pushed a commit that referenced this pull request Aug 27, 2026
…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.
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 30, 2026
* fix(codex): launch WSL accounts from direct homes

* fix(codex): coalesce WSL auth drains and validate distro homes

* fix(codex): preserve legacy WSL account home metadata

* fix(codex): retain marked WSL home compatibility

* fix(codex): verify the bytes the WSL drain promotes, not an earlier read

The apply script validated the source hash and then re-read it with cp, so a
legacy pane rotating in that window put bytes freshness never judged over a
valid account home. Codex rewrites auth.json in place, so that read can be torn.

Covers it by running the real guest script under sh with a sha256sum shim that
rotates the source between the two reads; without the guard it exits 0.

* fix(codex): harden WSL auth drain races

(cherry picked from commit ebcd637)
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 30, 2026
…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)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(codex): launch WSL accounts from direct homes

* fix(codex): coalesce WSL auth drains and validate distro homes

* fix(codex): preserve legacy WSL account home metadata

* fix(codex): retain marked WSL home compatibility

* fix(codex): verify the bytes the WSL drain promotes, not an earlier read

The apply script validated the source hash and then re-read it with cp, so a
legacy pane rotating in that window put bytes freshness never judged over a
valid account home. Codex rewrites auth.json in place, so that read can be torn.

Covers it by running the real guest script under sh with a sha256sum shim that
rotates the source between the two reads; without the guard it exits 0.

* fix(codex): harden WSL auth drain races
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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.
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.

2 participants