Skip to content

fix(codex): preserve WSL account home trust - #16496

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/sta-4606-wsl-mirror-removal
Aug 26, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/sta-4606-wsl-mirror-removal

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​222 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​210
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​31 $\color{#cf222e}{\Huge{\mathbf{−}}}$​63 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32

ELI5

WSL account homes now keep Codex's project and hook approvals when Orca refreshes their settings.

What Changed

  • Routes every per-account Codex home through the trust-preserving config mirror.
  • Gives WSL config mirroring a host-readable source path while preserving Linux path resolution.
  • Adds WSL coverage for retained project trust and keeps fresh-home seeding coverage.

Why

WSL account homes will become the live CODEX_HOME. A plain overwrite would erase trust Codex recorded there after each config sync.

Linked Issue

STA-4606

Visual Proof

N/A — config synchronization has no rendered UI change.

Testing

  • Automated tests added/updated
  • pnpm test src/main/codex src/main/codex-accounts src/main/agent-hooks (1,855 passed, 12 skipped)
  • pnpm typecheck
  • node config/scripts/check-changed-code-quality.mjs
  • Mutation check: restoring the WSL overwrite made preserves WSL account-home project trust while refreshing canonical settings fail.
  • Platforms exercised: automated filesystem coverage on macOS; Windows/WSL behavior is mocked. SSH is unaffected because this is local WSL account configuration.

Review

Agent skill upstream boundary

  • Not applicable.

Notes

This is the prerequisite trust-safety stage only; it does not change WSL 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 focused suites, full typecheck, and changed-code quality pass; CI covers remaining repository checks

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d843b9d-7638-4f31-a6e1-d7dc2abed08d

📥 Commits

Reviewing files that changed from the base of the PR and between 34f7d75 and 9c233f3.

📒 Files selected for processing (1)
  • src/main/codex-accounts/runtime-home-wsl-session-bridge.test.ts

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


📝 Walkthrough

Walkthrough

Canonical Codex configuration synchronization now uses the system configuration mirror for every managed home. The change removes host-specific branching, hook trust sanitization, relative-path rewriting, and direct managed-config writes. Canonical metadata now stores a host-readable source home path and no longer tracks a hooks path. WSL account tests verify directory-based canonical homes, Windows/Linux path mapping, settings replacement, and project trust preservation.

Merge Risk: ⚪ Minimal · up to 9c233

The change preserves WSL account-home trust while refreshing settings and adds focused automated coverage; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preserving trust data in WSL Codex account homes.
Description check ✅ Passed The description includes the required sections, explains the change and rationale, documents testing, records the lack of UI changes, and confirms checklist items. The linked issue is identified as ST…
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 includes the required sections, explains the change and rationale, documents testing, records the lack of UI changes, and confirms checklist items. The linked issue is identified as STA-4606, although it is not formatted as a Fixes # link.

  • 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.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron validation evidence (PR 16496)

Launched this worktree via config/scripts/run-electron-vite-dev.mjs with REMOTE_DEBUGGING_PORT=9333 and a throwaway ORCA_DEV_USER_DATA_PATH. Playwright CDP attach confirmed identity:

  • devRepoRoot: /Users/brennanbenson/orca/workspaces/orca/sta-4606-stage-1-pr16496
  • devBranch: brennanb2025/sta-4606-wsl-mirror-removal
  • devLabel: sta-4606-stage-1-pr16496 @ brennanb2025/sta-4606-wsl-mirror-removal

Visible state: empty-workspace welcome ("Add a project to get started"), no Vite/runtime error overlay. Console: 0 errors. This is a config-sync change; no UI delta expected.

PR 16496 Electron UI

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

Verdict: land after fixes.

The review loop found and fixed three concrete issues without broadening product scope:

  • Preserved WSL account-home project/hook trust through the shared config mirror.
  • Preserved Linux /mnt/<drive> path semantics when Windows exposes the WSL home as a drive-letter path, both for account-home sync and the shared WSL launch mirror.
  • Updated an existing WSL test mock to retain the newly used toLinuxPath export.

Pushed commits:

  • 622ba9159d — preserve mounted-drive WSL config paths
  • 34f7d7532d — preserve mounted-drive WSL launch paths
  • 9c233f356a — preserve WSL path helpers in the test mock

Validation:

No mobile-facing, SSH/relay, wire protocol, or persisted schema changes were touched. The Windows low-spec remote runtime was unavailable during this session, so that platform runtime check remains unverified; the path behavior is covered by targeted Windows/WSL mocks.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Windows high-spec validation update

Attempted the requested remote validation on Windows high spec using Orca orchestration with a Grok/Electron worker and the registered stablyai/orca repo. The environment was discoverable, but the remote runtime timed out during remote_attach before a worktree or terminal was created; Orca reported no residual resources. The dispatch was safely abandoned without stopping unrelated processes. No new screenshot was produced from that host, so the existing local Electron screenshot remains the available UI evidence.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Final review status

Verdict: code review clean; merge remains gated by current CI.

The same-model review loop ran through the focused fixes and the final readiness pass reported PASS. The branch is clean at 9c233f356a, with no additional scope added.

Validated locally:

The requested Windows high-spec Grok/Electron run was retried after the runtime became reachable. Orca created/reused the disposable worktree, but Grok prompt delivery stalled before the worker could start (agent_prompt_stalled); no validation screenshot was produced from that host and no residual worker resources remain. The existing local Electron evidence is still attached above.

The current GitHub PR Checks run is red on unrelated src/renderer/src/components/automations/* errors (unused imports, missing symbols, and a failing automation notice-recovery test); none are in this PR's diff, and the focused local suites pass. Those mainline/merge-base failures need to be resolved or rerun before GitHub can report the PR green.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron visual proof (STA-4606 / PR 16496)

Launched this worktree via CDP (REMOTE_DEBUGGING_PORT=9333, identity sta-4606-stage-1-pr16496 @ brennanb2025/sta-4606-wsl-mirror-removal). This PR has no renderer/UI change; closest reachable surface is Settings → AI Provider Accounts (Codex). WSL is not available on this Mac (wsl.isAvailable() === false), so the WSL trust-preserving mirror path was not exercised in the running app.

Backing state: codexConfigSync.status = { state: "synced", reason: null, systemConfigPath: "/Users/brennanbenson/.codex/config.toml" }. Renderer console: 0 errors. Native [codex-trust-grant] succeeded. Orchestration settings pane is healthy (skill up to date); main-process legacy worker provider-ready recovery failed Error: terminal_liveness_unavailable is not user-visible and is not in this PR's diff.

Before — empty home (isolated profile)

01-before-home.png

After — AI Provider Accounts / Codex (closest related UI)

02-after-accounts.png

Orchestration settings (no PR UI change; pane renders)

03-orchestration.png

Screenshots are not committed. Full notes: /tmp/orca-electron-qa-sta-4606/REPORT.md.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review update — Windows high-spec WSL validation

Validated PR 9c233f356a0d6883eec5e58ba2c2e78af5a238f1 in the disposable Windows high spec environment:

  • Host: Windows high spec, WSL2 kernel microsoft-standard-WSL2
  • Electron dev instance: sta-4606-win-high-review-3 @ 9c233f356a
  • CDP page: http://localhost:5173/
  • Renderer/runtime errors: 0 (ERRORS [])
  • UI: Orca rendered successfully with the sidebar and empty-workspace state visible.
  • Screenshot: Windows high-spec WSL Electron

The review fixes remain focused on WSL path/config semantics and test coverage. Final readiness review is PASS; no additional regressions or performance issues were found.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Additional transparency: the WSL Electron main log showed the pre-existing non-fatal [orchestration] legacy worker provider-ready recovery failed (terminal_liveness_unavailable) warning while restoring stale orchestration state in the disposable environment. Electron still launched and the CDP renderer reported ERRORS []; this warning is outside the PR diff. GitHub CI currently still has the known unrelated Automations failures noted in the earlier status comment.

@brennanb2025
brennanb2025 merged commit e8005c3 into main Aug 26, 2026
37 of 48 checks passed
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
* fix(codex): preserve WSL account home trust

* fix(codex): preserve WSL drive path semantics

* fix(codex): preserve mounted-drive WSL config paths

* test(codex): preserve WSL path helpers in mock
rahuljangirworks pushed a commit to rahuljangirworks/veer that referenced this pull request Aug 27, 2026
* fix(codex): preserve WSL account home trust

* fix(codex): preserve WSL drive path semantics

* fix(codex): preserve mounted-drive WSL config paths

* test(codex): preserve WSL path helpers in mock
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 28, 2026
* fix(codex): preserve WSL account home trust

* fix(codex): preserve WSL drive path semantics

* fix(codex): preserve mounted-drive WSL config paths

* test(codex): preserve WSL path helpers in mock

(cherry picked from commit e8005c3)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(codex): preserve WSL account home trust

* fix(codex): preserve WSL drive path semantics

* fix(codex): preserve mounted-drive WSL config paths

* test(codex): preserve WSL path helpers in mock
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