Skip to content

refactor(codex): make WSL account surfaces direct-home aware - #16499

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

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

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​87 $\color{#cf222e}{\Huge{\mathbf{−}}}$​34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​47 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16

ELI5

Orca can now find and prepare Codex data in each WSL account's own home before launch routing changes.

What Changed

  • Installs background WSL Codex hooks into the guest's real ~/.codex instead of the legacy runtime mirror.
  • Includes WSL managed-account homes in AI Vault and native-chat transcript discovery.
  • Prevents WSL session resume from consulting the unrelated host-account selection.

Why

The direct-home cutover needs hook, discovery, and resume surfaces to understand per-account WSL homes first. These changes are independently safe and do not alter launch routing.

Linked Issue

STA-4606

Visual Proof

N/A — these are background hook and transcript-path changes with no rendered UI change.

Testing

  • Automated tests added/updated
  • pnpm test src/main/codex src/main/codex-accounts src/main/agent-hooks src/main/native-chat (2,138 passed, 12 skipped)
  • pnpm typecheck
  • node config/scripts/check-changed-code-quality.mjs
  • Mutation checks restored the old hook override, WSL-root omission, native-chat omission, and host-lane resume lookup; each named regression test failed.
  • Platforms exercised: automated filesystem and relay coverage on macOS with Windows/WSL paths mocked. SSH remains lane-scoped and does not use these local WSL roots.

Review

Depends on #16496.

Agent skill upstream boundary

  • Not applicable.

Notes

This is the additive surface-preparation stage only; it does not change CODEX_HOME launch routing.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • N/A for screenshots because there is no UI change
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path impact considered
  • Required suites, full typecheck, and changed-code quality pass; CI covers remaining repository checks

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron UI validation (Grok / Playwright CDP)

Launched this worktree (sta-4606-stage-2-pr16499 / brennanb2025/sta-4606-wsl-mirror-removal-stage-2) with CDP 9334, renderer 5175, and isolated ORCA_DEV_USER_DATA_PATH=/tmp/orca-electron-profile.AjPtQU. window.api.app.getIdentity() returned this worktree root and branch.

The PR has no renderer/UI code changes. Adjacent surfaces were exercised anyway:

  1. Idle empty profile (no workspaces)
  2. Agents / Agent Session History (AI Vault) — Local Mac, 250 sessions, Codex + Grok rows
  3. Session History host picker — Local Mac / All hosts only (no WSL host on this Mac)
  4. Settings → AI Provider Accounts → Codex — system default [email protected], no managed Codex accounts

Screenshots

Before (idle empty profile)
01-before-idle.png

After: Agent Session History
02-after-ai-vault.png

After: host picker (Local Mac / All hosts)
03-vault-host-picker.png

After: Codex accounts pane
04-after-codex-accounts.png

Blockers / gaps

  • WSL-specific discovery, hook install into guest ~/.codex, and WSL resume routing cannot be exercised on this macOS host.
  • Isolated profile has no workspaces, so Resume in New Tab is disabled (Unavailable worktree).
  • No rendered UI regression observed on the adjacent Local Mac surfaces.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: land after fixes

Completed the scoped review loop for PR #16499.

  • Found and fixed a real regression: stage 2 had removed redirected CODEX_HOME support from the WSL relay hook installer even though current WSL launches still use Orca’s managed runtime home. The fix restores the explicit runtime-home target and deferred trust seeding, with regression/integration coverage.
  • Pushed commits 2e30509fff and ebea84ea9c to the PR branch.
  • Validation: focused WSL/Codex/native-chat suites passed (216 files, 2,140 tests passed; 1 skipped file, 12 skipped tests), targeted relay/install suites passed (43 tests), oxlint passed, git diff --check passed, and pnpm tc completed successfully.
  • Final same-model review found no remaining correctness, scope, cross-platform, or performance issues. No mobile-facing surface was changed; SSH wire behavior was not in scope.
  • Grok Electron validation used the exact worktree with isolated profile/CDP, verified app identity, exercised Agent Session History, host picker, and Codex account settings, and attached full-context screenshots here: refactor(codex): make WSL account surfaces direct-home aware #16499 (comment). WSL runtime behavior remains unproven on this macOS host.
  • OSS precedent sync and readiness bookend reviews found no additional proven release-blocking findings. Residual risk is limited to platform-specific WSL runtime execution not available on this host.

Recommendation: land after the pushed fixes; keep the existing WSL/Windows CI coverage as the platform-specific gate.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Windows high-spec validation follow-up (PR head ebea84ea9c97b777a79b91c486aa7573fa15d514):

  • Existing Orca worktree C:\Users\neil\orca\workspaces\orca\sta-4606-windows-high-qa was verified at the exact PR head with no source changes.
  • The requested Grok + $electron/Playwright CDP run is blocked on this host: the WSL/default shell reports Command \grok\\ not found, and a native cmd.exe /c where grok probe found no executable. Per the Electron validation constraints, I did not substitute Orca computer-use or OS-level automation.
  • No Windows screenshots are claimed or uploaded from this blocked attempt. The prior macOS Electron screenshots remain attached in the earlier review comment.
  • End readiness checklist: clean; targeted WSL/relay suites 66 tests passed, no proven P0/P1/P2 findings. Residual risk is only O(account count) recursive fallback scanning across managed WSL homes on cache misses.

Status: land after fixes; Windows-specific rendered validation remains blocked by missing Grok tooling on the high-spec host.

@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 changed the base branch from brennanb2025/sta-4606-wsl-mirror-removal to main August 26, 2026 21:48
@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Too many files changed for review (1802 files, 100 file limit).

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Rebased Windows high-spec Electron validation completed on PR head 14e33f59cb37c54a7658a8a62c5d7068dc6263fc (base main).

  • Orca-managed worktree: C:/Users/neil/orca/workspaces/orca/sta-4606-windows-direct-qa
  • Native Windows Electron launched with isolated profile and CDP on 127.0.0.1:19225.
  • Playwright CDP verified window.api.app.getIdentity(): OrcaWin/sta-4606-windows-direct-qa, matching the worktree and rebased head.
  • Rendered settings and AI Provider Accounts (Windows/WSL account-location surface) loaded successfully; captured console/page errors: none.
  • Targeted local tests after rebase: 6 files, 73 tests passed; git diff --check passed; worktree clean.
  • Screenshots (full context, never committed):
    • Windows settings
    • Windows AI provider accounts

Status: land after fixes. No new correctness or scope issues found.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Final readiness-checklist rerun on rebased HEAD 14e33f59cb:

  • 5 targeted test files / 89 tests passed.
  • git diff --check passed and the review worktree is clean.
  • No proven P0/P1/P2 findings; no concrete Windows/WSL or mobile-backcompat regressions.
  • Residual performance risk remains the previously noted O(account count) recursive fallback scan on cache misses across managed WSL homes.

Recommendation remains land after fixes.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

CI diagnosis (run 33017012853):

  • detect code-relevant changes failed before any PR checks ran: Node hit EAGAIN: resource temporarily unavailable, read in config/scripts/pr-code-change-scope.mjs.
  • verify is a dependent failure because CODE_PATHS was failure; it did not report a code/test assertion.
  • Native Ubuntu, Windows, and macOS smoke checks passed, as did root-directory and test-LoC checks.

This is consistent with a transient GitHub-hosted runner/I/O failure, not a regression attributable to PR #16499 or main. Please rerun the failed checks.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Update: rerun attempt 2 reproduced the same EAGAIN: resource temporarily unavailable, read failure in config/scripts/pr-code-change-scope.mjs at readFileSync(0, "utf8"). That classifier/workflow is unchanged by this PR and comes from main; all code-relevant checks therefore remain skipped. This still looks like a CI/main workflow-runner issue, but the required verify gate is red and the full suite has not run.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Root cause identified: the failed workflow event was created while this PR still targeted the stage-1 base (BASE_SHA=9c233f…). The PR now targets main (ef0d593…), but reruns retain the original event payload, so the classifier is diffing the wrong/larger range and repeatedly hits EAGAIN in readFileSync(0). No main code fix is indicated. A fresh pull_request event with the current base SHA is needed (for example, close/reopen the PR or let the next real synchronize event trigger it); avoid adding a no-op source commit.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Close/reopen successfully refreshed the workflow event. In new run 33023098911, detect code-relevant changes and the root-directory guard have passed, and the full code-check matrix is now running.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

CI update: fresh run 33023098911 completed successfully. The prior red attempts remain visible in workflow history, but the current path classifier, full test matrix, typecheck, static analysis, packaging, compatibility checks, and verify all pass. PR merge state is CLEAN / MERGEABLE.

@brennanb2025
brennanb2025 merged commit 07f2e14 into main Aug 27, 2026
102 of 108 checks passed
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…i#16499)

* refactor(codex): make WSL account surfaces direct-home aware

* fix(wsl): keep Codex relay hooks on managed runtime home

* test(wsl): assert relay hooks use managed Codex home
rahuljangirworks pushed a commit to rahuljangirworks/veer that referenced this pull request Aug 27, 2026
…i#16499)

* refactor(codex): make WSL account surfaces direct-home aware

* fix(wsl): keep Codex relay hooks on managed runtime home

* test(wsl): assert relay hooks use managed Codex home
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 28, 2026
…i#16499)

* refactor(codex): make WSL account surfaces direct-home aware

* fix(wsl): keep Codex relay hooks on managed runtime home

* test(wsl): assert relay hooks use managed Codex home

(cherry picked from commit 07f2e14)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…i#16499)

* refactor(codex): make WSL account surfaces direct-home aware

* fix(wsl): keep Codex relay hooks on managed runtime home

* test(wsl): assert relay hooks use managed Codex home
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