Skip to content

fix(pty): load omp status extension in wsl shells - #7642

Merged
brennanb2025 merged 2 commits into
stablyai:mainfrom
rodboev:pr/orca-7091-wsl-omp-extension
Jul 8, 2026
Merged

brennanb2025 merged 2 commits into
stablyai:mainfrom
rodboev:pr/orca-7091-wsl-omp-extension

Conversation

@rodboev

@rodboev rodboev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Force WSL launches to use the managed Orca userData root, materialize the shell-ready wrapper tree from the shared Windows shell-args path, then reuse the existing OMP wrapper so interactive launches get --extension while OMP subcommands keep their normal argv shape.
  • Keep the change on the WSL launch path; non-WSL attribution shell family selection stays on the existing resolver and non-WSL dev-mode terminals keep their prior userData behavior.

Closes #7091.

Screenshots

No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Focused validation run in this session:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty.test.ts src/main/providers/windows-shell-args.test.ts src/main/providers/local-pty-shell-ready.test.ts src/main/pty/wsl-orca-env.test.ts src/shared/wsl-login-shell-command.test.ts src/main/pty/omp-shell-wrapper.node-pty.test.ts - passed, Test Files 5 passed | 1 skipped (6), Tests 247 passed | 44 skipped (328).
  • pnpm exec vitest run --config config/vitest.config.ts --reporter=verbose src/main/ipc/pty.test.ts -t "forces managed ORCA_USER_DATA_PATH for WSL spawns even when the caller provides a stale root" - passed, Test Files 1 passed (1), Tests 1 passed | 215 skipped (216).
  • pnpm exec vitest run --config config/vitest.config.ts --reporter=verbose src/main/providers/windows-shell-args.test.ts - passed, Test Files 1 passed (1), Tests 23 passed (23), including materializes shell-ready wrappers before building WSL shell args.
  • pnpm run typecheck:node - passed.

AI Review Report

  • No correctness issues found in the final diff.
  • The WSL-only wrapper materialization runs from the shared Windows shell-args path before WSL login-shell assembly, so both local and daemon launches get the same wrapper tree.
  • The shared IPC env builder now rewrites WSL ORCA_USER_DATA_PATH to the managed root, so wrapper creation and WSL consumption stay aligned.
  • The OMP wrapper still reuses existing shell-ready logic; no second --extension implementation was added.

Security Audit

  • No new subprocesses, no new network endpoints, and no credential handling changes.
  • ORCA_USER_DATA_PATH remains a local path export imported into WSL via WSLENV; the new wrapper write stays inside that user-data tree.
  • The WSL override narrows host-state coupling by replacing stale caller input with Orca's managed root.
  • Loopback transport remains out of scope and still belongs to [Bug]: WSL OMP agents no longer appear in the worktree sidebar after v1.4.124 #7565.

Notes

  • WSL itself is not installed on this host, so the install banner printed during validation was expected and did not affect the unit tests.
  • The stale-root regression for ORCA_USER_DATA_PATH is covered by src/main/ipc/pty.test.ts.
  • src/main/providers/windows-shell-args.test.ts > resolveWindowsShellLaunchArgs > materializes shell-ready wrappers before building WSL shell args is the proof surface for the routing fix.
  • [Bug]: WSL OMP agents no longer appear in the worktree sidebar after v1.4.124 #7565 tracks the separate WSL loopback transport failure after the extension is loaded. This PR proves extension loading configuration, not transport delivery.

@coderabbitai

coderabbitai Bot commented Jul 7, 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

Run ID: a4f1f305-f131-4c1a-b7f4-691bd0ceab15

📥 Commits

Reviewing files that changed from the base of the PR and between 7f6d878 and f339e95.

📒 Files selected for processing (2)
  • src/main/providers/local-pty-shell-ready.ts
  • src/main/providers/windows-shell-args.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/providers/windows-shell-args.test.ts

📝 Walkthrough

Walkthrough

Changes

This PR forwards ORCA_USER_DATA_PATH into WSL spawn environments and WSLENV, makes shell-ready wrapper resolution and creation root-aware, and wires wrapper preparation into WSL shell argument generation. The WSL login-shell command now uses wrapper files for bash and zsh when present. Tests were updated for attribution shim path handling, WSL env propagation, wrapper creation, and wsl.exe launch behavior.

Related PRs: None specified.

Suggested labels: windows, wsl, tests

Suggested reviewers: None specified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the WSL OMP extension-loading fix.
Description check ✅ Passed The description covers summary, screenshots, testing, security, notes, and an AI review report.
Linked Issues check ✅ Passed The changes address #7091 by ensuring WSL launches load the managed extension via the shell-ready wrapper path.
Out of Scope Changes check ✅ Passed All changes are tied to the WSL extension-loading fix, with supporting tests and shell-path updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

🧹 Nitpick comments (1)
src/shared/wsl-login-shell-command.ts (1)

59-63: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Consider validating individual zsh dotfiles, not just the directory.

The bash branch checks the specific rcfile (-f .../bash/rcfile), but the zsh branch only checks that the zsh directory exists (-d). If a prior wrapper-write attempt partially failed (per the catch block in ensureShellReadyWrappersAt, e.g. .zlogin — which hosts the OMP wrapper — failed to write while the directory and other files succeeded), ZDOTDIR would still be set to an incomplete directory, silently dropping the OMP extension load without any fallback signal.

♻️ Proposed tightening of the zsh existence check
-    if [ -n "${_orca_shell_ready_root:-}" ] && [ -d "${_orca_shell_ready_root}/zsh" ]; then
+    if [ -n "${_orca_shell_ready_root:-}" ] && [ -f "${_orca_shell_ready_root}/zsh/.zlogin" ]; then

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e2a5037c-9da3-4c27-a413-c7d3d46e82b8

📥 Commits

Reviewing files that changed from the base of the PR and between 98d850a and 7f6d878.

📒 Files selected for processing (9)
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/providers/local-pty-shell-ready.ts
  • src/main/providers/windows-shell-args.test.ts
  • src/main/providers/windows-shell-args.ts
  • src/main/pty/wsl-orca-env.test.ts
  • src/main/pty/wsl-orca-env.ts
  • src/shared/wsl-login-shell-command.test.ts
  • src/shared/wsl-login-shell-command.ts

@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for this — reusing the shell-ready wrapper tree to carry --extension into WSL launches is the right mechanism, and the validation notes were helpful. We're going to take it from here and make a small fix-up before landing it (the wrapper-root precedence change needs to be reverted — it can regress nested launches). Appreciate the contribution!

Revert the getShellReadyWrapperRoot precedence flip: env-first let an
inherited ORCA_USER_DATA_PATH (Orca launched from another Orca's
terminal) win over app.getPath('userData'), diverging the wrapper
writer root from the root buildPtyHostEnv forces onto WSL children —
the rcfile the child looks for was never written, silently disabling
the omp extension shim. It also changed wrapper-root resolution on
every local macOS/Linux spawn for no WSL reason. app-first restores
the pre-existing behavior; the WSL fix only needs the env fallback in
app-less contexts (daemon, tests), which both orderings preserve.

Also pin the end-to-end contract in windows-shell-args.test.ts: the
materialized bash rcfile and zsh .zlogin must carry the omp
--extension wrapper a WSL launch exists to deliver.

Co-authored-by: Orca <[email protected]>
@brennanb2025
brennanb2025 merged commit a09a00f into stablyai:main Jul 8, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.

[Bug]: WSL OMP status env is injected but the managed extension is not loaded

2 participants