Repository navigation
fix(onboarding): run skill setup in the configured Windows runtime (#12103) - #12204
Conversation
…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
📝 WalkthroughWalkthroughOnboarding 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)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/onboarding/onboarding-feature-setup-runtime.ts (1)
9-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
getOnboardingFeatureSetupAgentRuntimeinrunOnboardingFeatureSetup.
runOnboardingFeatureSetupinonboarding-feature-setup.tscomputesruntimeContext?.installDisabledReason ? undefined : runtimeContext?.agentRuntimeinline. This duplicates the exact logic ingetOnboardingFeatureSetupAgentRuntime. Replace the inline check with a call to this helper (guarding for an undefinedruntimeContext) 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
📒 Files selected for processing (10)
src/renderer/src/components/feature-wall/AgentCapabilitiesSetupAction.tsxsrc/renderer/src/components/feature-wall/FeatureWallBrowserAction.tsxsrc/renderer/src/components/onboarding/FeatureSetupInlineTerminal.test.tsxsrc/renderer/src/components/onboarding/FeatureSetupInlineTerminal.tsxsrc/renderer/src/components/onboarding/onboarding-feature-setup-runtime.tssrc/renderer/src/components/onboarding/onboarding-feature-setup.test.tssrc/renderer/src/components/onboarding/onboarding-feature-setup.tssrc/renderer/src/hooks/useActiveProjectSkillRuntime.test.tsxsrc/renderer/src/hooks/useActiveProjectSkillRuntime.tssrc/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
…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]>
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.FeatureSetupInlineTerminalspawned a bare terminal with no shell override and handed it the rawnpx skills add .... Where Node lives inside WSL,npxis not on the Windows PATH, so it failed exactly as the reporter described.Behind that sat a second gap.
getLocalProjectExecutionRuntimeContextonly consults per-project settings, and onboarding runs before any project exists — with no project it returnsundefinedand 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.getLocalAgentPreflightContextalready 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 asgetGlobalWindowsExecutionRuntimeContextand 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: awindows-hostdefault already matches the previous no-project behavior, and resolving it here would hand skill discovery adiscoveryTargetwhere 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 viainstallWslrather than the hostinstall, soorcalands 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
useActiveProjectSkillRuntime.test.tsx: adopts a global WSL default with no project; ignores awindows-hostdefault so discovery keeps no target; does not adopt the global default once a project is active.onboarding-feature-setup.test.ts: copied command is WSL-wrapped for a WSL runtime, left bare for a host runtime.components/onboarding,components/feature-wall,hooksandlibpass 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.exebut no distro installed, so I could not exercise a realwsl.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.