Skip to content

fix(onboarding): run skill setup in the configured Windows runtime (#12103) - #12204

Merged
OrcaWin merged 4 commits into
mainfrom
OrcaWin/bug-after-reinstalling-orca-orca-got-stuck-on-a
Aug 3, 2026
Merged

OrcaWin merged 4 commits into
mainfrom
OrcaWin/bug-after-reinstalling-orca-orca-got-stuck-on-a

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes the second half of #12103: on Windows with a WSL runtime configured, the onboarding wizard ran its tool-install command in a Windows shell, so the install failed.

Problem

Onboarding was the one skill-setup surface that did not route its command through the resolved runtime. Settings → CLI, the feature-wall panels and the Linear setup prompt all wrap theirs as wsl.exe -d <distro> -- sh -c ... and pass a matching shell override. FeatureSetupInlineTerminal spawned a bare terminal with no shell override and handed it the raw npx skills add .... Where Node lives inside WSL, npx is not on the Windows PATH, so it failed exactly as the reporter described.

Behind that sat a second gap. getLocalProjectExecutionRuntimeContext only consults per-project settings, and onboarding runs before any project exists — with no project it returns undefined and callers fall through to the Windows host, ignoring the user's global WSL default entirely. So the wizard was wrong twice: it never asked for the runtime, and the resolver could not have answered.

getLocalAgentPreflightContext already had a "no project → honor the global default" branch for PATH detection. The skill-install path never got one.

Changes

  • local-preflight-context.ts — extract that fallback as getGlobalWindowsExecutionRuntimeContext and rewire the existing agent-preflight branch through it, so the two can't drift.
  • useActiveProjectSkillRuntime.ts — adopt it when no project is active. Deliberately WSL-only: a windows-host default already matches the previous no-project behavior, and resolving it here would hand skill discovery a discoveryTarget where it previously had none, re-triggering scans for every host-default user. An existing test caught this when the fallback was first written too broadly.
  • FeatureSetupInlineTerminal.tsx — build the command for the resolved runtime and pass its shell override, like every other setup surface.
  • onboarding-feature-setup.ts — register the CLI via installWsl rather than the host install, so orca lands on the PATH the install actually runs on, and wrap the copied command to match. Runtime threads through from the two feature-wall call sites.

Testing

  • 3 new cases in useActiveProjectSkillRuntime.test.tsx: adopts a global WSL default with no project; ignores a windows-host default so discovery keeps no target; does not adopt the global default once a project is active.
  • 2 new cases in onboarding-feature-setup.test.ts: copied command is WSL-wrapped for a WSL runtime, left bare for a host runtime.
  • 464 test files / 4305 tests across components/onboarding, components/feature-wall, hooks and lib pass on Windows. Typecheck and oxlint clean.

Not covered

The WSL path is verified by unit tests and code inspection, not an end-to-end run — the Windows machine I reproduced #12103 on has wsl.exe but no distro installed, so I could not exercise a real wsl.exe -d <distro> install. Worth a manual pass on a box with a distro before merge.

Unrelated to the black screen in the same issue, which was #11957 and is already fixed by #12040.

…12103)

Onboarding was the one skill-setup surface that did not route its install
command through the resolved runtime. Settings, the feature-wall panels and
the Linear prompt all wrap theirs as `wsl.exe -d <distro> -- sh -c ...` and
pass a matching shell override; onboarding spawned a bare terminal and handed
it the raw `npx skills add ...`. With Node inside WSL, npx is not on the
Windows PATH, so the install failed.

The runtime resolver had a second gap behind that: it only consulted
per-project settings, and onboarding runs before any project exists. With no
project it returned undefined and fell through to the Windows host, ignoring
a global WSL default entirely. `getLocalAgentPreflightContext` already had a
no-project fallback for PATH detection; the skill-install path had none.

- extract that fallback as `getGlobalWindowsExecutionRuntimeContext` and
  rewire the existing agent-preflight branch through it so the two cannot drift
- adopt it in `useActiveProjectSkillRuntime` when no project is active. WSL
  only: a windows-host default already matches the old no-project behavior,
  and resolving it would hand skill discovery a target where it had none,
  re-triggering scans for every host-default user
- build the onboarding terminal's command for the runtime and pass its shell
  override
- register the CLI in WSL rather than on the host, so `orca` lands on the PATH
  the install actually runs on, and wrap the copied command to match
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Onboarding setup resolves the active project skill runtime from project context or a global WSL default. Runtime-specific commands and shell overrides are used by the inline terminal and clipboard flow. WSL runtimes use WSL-specific CLI status and installation APIs. Feature-wall setup actions pass the active runtime into onboarding execution. Tests cover WSL command wrapping, host command preservation, and global runtime resolution rules.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, changes, testing, and limitation, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add all required template sections, including a screenshot statement, AI review and cross-platform checks, security audit findings, and platform-specific notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 15.79% which is insufficient. The required threshold is 80.00%. 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 states that onboarding skill setup now runs in the configured Windows runtime, which matches the main change.
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.
✨ 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.

🧹 Nitpick comments (1)
src/renderer/src/components/onboarding/onboarding-feature-setup-runtime.ts (1)

9-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse getOnboardingFeatureSetupAgentRuntime in runOnboardingFeatureSetup.

runOnboardingFeatureSetup in onboarding-feature-setup.ts computes runtimeContext?.installDisabledReason ? undefined : runtimeContext?.agentRuntime inline. This duplicates the exact logic in getOnboardingFeatureSetupAgentRuntime. Replace the inline check with a call to this helper (guarding for an undefined runtimeContext) so both call sites share one source of truth.

♻️ Proposed fix for onboarding-feature-setup.ts
-  const agentRuntime = runtimeContext?.installDisabledReason
-    ? undefined
-    : runtimeContext?.agentRuntime
+  const agentRuntime = runtimeContext
+    ? getOnboardingFeatureSetupAgentRuntime(runtimeContext)
+    : undefined

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c0e1860-b06f-4f56-b84b-b88fc3db5033

📥 Commits

Reviewing files that changed from the base of the PR and between 8028a1f and cc00eca.

📒 Files selected for processing (10)
  • src/renderer/src/components/feature-wall/AgentCapabilitiesSetupAction.tsx
  • src/renderer/src/components/feature-wall/FeatureWallBrowserAction.tsx
  • src/renderer/src/components/onboarding/FeatureSetupInlineTerminal.test.tsx
  • src/renderer/src/components/onboarding/FeatureSetupInlineTerminal.tsx
  • src/renderer/src/components/onboarding/onboarding-feature-setup-runtime.ts
  • src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts
  • src/renderer/src/components/onboarding/onboarding-feature-setup.ts
  • src/renderer/src/hooks/useActiveProjectSkillRuntime.test.tsx
  • src/renderer/src/hooks/useActiveProjectSkillRuntime.ts
  • src/renderer/src/lib/local-preflight-context.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/renderer/src/components/feature-wall/FeatureWallBrowserAction.tsx
  • src/renderer/src/components/feature-wall/AgentCapabilitiesSetupAction.tsx
  • src/renderer/src/lib/local-preflight-context.ts
  • src/renderer/src/components/onboarding/onboarding-feature-setup.ts

@OrcaWin
OrcaWin merged commit d48cac7 into main Aug 3, 2026
42 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#12103) (stablyai#12204)

* fix(onboarding): run skill setup in the configured Windows runtime (stablyai#12103)

Onboarding was the one skill-setup surface that did not route its install
command through the resolved runtime. Settings, the feature-wall panels and
the Linear prompt all wrap theirs as `wsl.exe -d <distro> -- sh -c ...` and
pass a matching shell override; onboarding spawned a bare terminal and handed
it the raw `npx skills add ...`. With Node inside WSL, npx is not on the
Windows PATH, so the install failed.

The runtime resolver had a second gap behind that: it only consulted
per-project settings, and onboarding runs before any project exists. With no
project it returned undefined and fell through to the Windows host, ignoring
a global WSL default entirely. `getLocalAgentPreflightContext` already had a
no-project fallback for PATH detection; the skill-install path had none.

- extract that fallback as `getGlobalWindowsExecutionRuntimeContext` and
  rewire the existing agent-preflight branch through it so the two cannot drift
- adopt it in `useActiveProjectSkillRuntime` when no project is active. WSL
  only: a windows-host default already matches the old no-project behavior,
  and resolving it would hand skill discovery a target where it had none,
  re-triggering scans for every host-default user
- build the onboarding terminal's command for the runtime and pass its shell
  override
- register the CLI in WSL rather than on the host, so `orca` lands on the PATH
  the install actually runs on, and wrap the copied command to match

* fix(onboarding): keep skill setup runtime consistent

* test(onboarding): satisfy runtime settings contract

---------

Co-authored-by: OrcaWin <[email protected]>
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