Repository navigation
fix(skills): pass -y so the pasted skill install never stalls on a prompt - #11254
brennanb2025 wants to merge 6 commits into
Conversation
…ompt The install command every Settings and onboarding card pastes into a live terminal omitted `-y`. With more than one agent installed (Claude Code + Codex + Pi, say) the skills CLI stops on an agent-selection prompt, and closing the panel tears the session down mid-prompt. With exactly one agent the CLI auto-installs and never prompts, which is why only multi-agent setups hit it. One line covers macOS, Linux, native Windows, and WSL, because the Windows rewrite and the WSL base64 wrapper both wrap this same string. It matters most on WSL, where OrchestrationSetupCard passes no freshnessSkillName and the terminal path is the only one available. Also replaces the self-comparing assertion in the shared test, which compared the exported constant to the builder that produced it and so could never fail.
Greptile SummaryThis PR fixes a UX-breaking bug where the skill install command pasted into a user's terminal could stall on interactive prompts — once from npm asking to install the The fix is a one-line change to
Confidence Score: 5/5Safe to merge — the change is a single-line fix to a command builder that adds two well-understood non-interactive flags, matching an existing pattern in the headless updater path. The change is minimal and isolated: one line in the command builder, with all downstream surfaces inheriting it automatically. The flags added ( Files Needing Attention: No files require special attention. The
|
| Filename | Overview |
|---|---|
| src/shared/agent-feature-install-commands.ts | Core fix: adds --yes to npx and -y to skills CLI in the single command builder; all downstream surfaces pick up the flags automatically. Well-commented rationale inline. |
| src/shared/agent-feature-install-commands.test.ts | Replaced previously vacuous self-referential assertions with literal-string expectations; added new tests pinning both flags and the empty-list throw. |
| src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx | Removed import of the builder and replaced two tautological assertions with pinned literals, providing real coverage that both flags survive the Windows reinstall rewrite. |
| src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsx | Pinned the full WSL-wrapped command as a literal, confirming both flags survive the base64/login-shell wrapper path. |
| src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts | Updated literal assertion to include both new flags; verifies the all-skills install command shape. |
| src/renderer/src/components/settings/OrchestrationPane.test.tsx | Updated INSTALL_COMMAND constant to include both flags; UPDATE_COMMAND aliased to INSTALL_COMMAND is intentional for the Windows reinstall-rewrite path. |
| src/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx | Two assertions updated to pin the new command with both flags — one for rendered text, one for clipboard write. |
| src/renderer/src/components/skills/skill-freshness-skipped-reason.test.ts | Updated to pin both flags in the manual-recovery reinstall command shown when the background updater gives up. |
| src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx | Updated toContain assertion to include both flags for the freshness update dialog's rendered command. |
Reviews (6): Last reviewed commit: "docs(skills): attribute the CLI's instal..." | Re-trigger Greptile
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe shared skill installation command builder now generates non-interactive global installation commands using 🚥 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 |
The two Windows-host assertions compared buildSkillCommandForRuntime against buildAgentFeatureSkillInstallCommand — the exact call the code under test makes — so they passed with or without -y. Pin the literals instead.
The pasted install command still stalled on npm's "Need to install the following packages ... Ok to proceed?" whenever `skills@latest` was not already in the npx cache — npx re-resolves the tag on every run, so a first-time or outdated cache prompts. That is the same PTY-teardown failure `-y` was added to fix. The headless updater already documents both flags as load-bearing; the pasted command now matches it.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/shared/agent-feature-install-commands.ts (1)
15-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the added rationale concise.
Replace the four-line explanation with one short comment stating why both flags are required.
As per coding guidelines, TypeScript comments should be concise, limited to non-obvious information, and preferably one line.
Proposed simplification
- // Why: pasted into a live terminal, so any prompt strands the user and closing the panel - // kills the session mid-prompt. Both flags are load-bearing, as in the headless updater: - // `npx --yes` skips npm's install-this-package prompt (npx re-resolves `latest` every - // run, so a cold or stale cache prompts); `skills … -y` skips agent selection. + // Keep both flags: `npx --yes` skips npm's package prompt; `-y` skips agent selection.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 208f63a3-2914-46ee-b20d-f0b0e321a2c0
📒 Files selected for processing (9)
src/renderer/src/components/onboarding/onboarding-feature-setup.test.tssrc/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsxsrc/renderer/src/components/settings/OrchestrationPane.test.tsxsrc/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsxsrc/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/skill-freshness-skipped-reason.test.tssrc/shared/agent-feature-install-commands.test.tssrc/shared/agent-feature-install-commands.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts
- src/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx
- src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx
Round 2 replaced the WSL assertion with a `bash -lc 'npx --yes skills add` prefix, which dropped both the distro and the trailing `-y` from coverage: removing `-y` left this file green. Pin the panel's `command` prop whole.
The comment said `-y` skips agent selection, implying a single-agent host never prompts. It does: with `--global` the CLI targets the canonical `~/.agents/skills` dir plus the provider's, so `uniqueDirs.size > 1` and the "Installation method" select fires with one agent installed. Verified against [email protected] in a scrubbed non-agent env — without `-y` the install blocks on that select; with `-y` it completes.
… CLI's Converges with stablyai#11254 (fixes stablyai#9567): a pasted Settings install stalls on npm's fetch prompt and the skills agent picker exactly as a spawned one does, so `npx --yes` and `-y` are unconditional on install rather than a CLI-only opt-in. The desktop and CLI install commands are now byte-identical. Update keeps them opt-in and the CLI alone passes them: the pasted update string has to stay `npx skills update <name> --global` because normalizeWindowsSkillUpdateCommand parses that exact shape to swap in a reinstall on native Windows, and the extra flags stop it matching. Pinned with a test so the two cannot drift apart silently.
|
Closing this — the premise is wrong, and the evidence for that was already on #9567 before I opened it.
They then asked the reporter two specific questions — did you press Enter to run the pre-filled command, and did the agent-selection list respond to arrow keys and space — and got no reply. So the interactive prompt is deliberate, and this PR would have suppressed it to fix something that was never actually established. Reading the
The CLI also already handles the case that matters for automation: when it detects it is running inside an agent it sets The #9567 is still a real bug — just not this one. The undisputed part of that report is that Settings showed the install completing while the spawned command exited 1, and that Re-check only re-reads the cached failed status instead of re-running, so the indicator can never self-heal. That is worth fixing, and the two questions |
Fixes #9567
The bug
buildAgentFeatureSkillInstallCommandinsrc/shared/agent-feature-install-commands.tsproduces the command that every Settings and onboarding skill card pastes into a terminal:That command is pasted, not auto-run —
OnboardingInlineCommandTerminal.tsxdispatchesPASTE_TERMINAL_TEXT_EVENTwithcommand.trim()and no trailing newline, into a session whose cwd is$HOME.It could stall on prompts from two separate programs — npm and the
skillsCLI — and either one strands the user. Closing the panel then tears the PTY down mid-prompt — which is exactly the reporter'ssession-killed: immediate: true/exit 1.npm's own prompt.
npx skills …without--yesblocks onNeed to install the following packages: [email protected] / Ok to proceed?whenever the package is missing from the npx cache (libnpmexec/lib/index.js, the TTY branch). This is not just a first-run cost:missingFromTreedocuments that for a bare name in the npx tree it "check[s] if a newer version is available", so the prompt returns every time upstream publishes.The
skillsCLI's own prompts. Without-ythe CLI blocks before it finishes, and it does so for every user — not only the multi-agent case in the report. TheProceed with installation?confirm is gated on!options.yesalone. The "Installation method" select fires even when exactly one agent is installed, because the CLI callsensureUniversalAgentsand appends its universal.agents/skillstargets to the detected agent's own dir, makinguniqueDirs.size > 1. That set is built from each agent's relativeskillsDir, so the trigger is the universal-target expansion, not--global. Agent selection fires on top of that whenever more than one agent is installed.Verified directly against
[email protected]in a scrubbed, non-agent env with exactly one installed agent (Claude Code): without-ythe run stops rendering at◆ Installation methodand waits; adding-yalone takes the identical command through toInstalled 1 skill/Done!. (The CLI setsoptions.yes = trueby itself when it detects it is running inside an agent, which is why an agent-run probe never reproduces the stall.)The fix
Build the command with both non-interactive flags. One line covers macOS, Linux, native Windows, and WSL, because both platform rewrites in
CliSkillRuntimeSetup.tsxwrap this same string rather than rebuilding it:update→ reinstall rewrite (normalizeWindowsSkillUpdateCommand), which callsbuildAgentFeatureSkillInstallCommandand so now also yields a non-interactive command.The two flags are distinct and both load-bearing, which is already the established pattern in this repo:
src/main/skills/skill-update-run.tsspawns['--yes', 'skills', 'update', …, '--global', '-y']with a docblock spelling out why. The pasted command now matches the headless one.It matters most on WSL:
OrchestrationSetupCard.tsxpassesfreshnessSkillName={undefined}when the runtime iswsl, so WSL users get no background updater at all and the terminal paste is their only path.skill-freshness-skipped-reason.ts— the manual-recovery sentence shown when the background updater gives up and hands the user a reinstall command — derives from the same builder and picks the flags up for free. Covered by an updated assertion.--globalis deliberately keptA prior proposal (#6580) suggested dropping
--global. That premise does not hold on currentmain:src/main/skills/skill-discovery-sources.tsdeliberately scans ten provider home roots (.codex/skills,.agents/skills,.claude/skills,.grok/skills,.config/opencode/skills,.pi/agent/skills,.gemini/skills,.gemini/antigravity/skills,.cursor/skills,.codex/plugins/cache) precisely because--globalwrites there — the in-repo comment states that intent explicitly. Removing it would narrow discovery coverage.What
-yauto-accepts, and why none of it regresses OrcaInstall method (symlink vs copy).
-yskips the "Installation method" select, leaving the CLI's own recommended default: symlink. That is the effective default in practice, not an edge case, since more than one distinct skills dir is targeted even for a single agent. Orca models that shape as a first-class topology:classifyHomeSkillTopologyreturnsprovider-aliasfor a link into~/.agents/skills, andtopologyDedupeBucketbucketsprovider-aliastogether withcanonical-copyasmanaged-global. So a symlinked install is treated as managed, not as a modified or unmanaged copy.Confirmed on disk after a real
-yinstall:~/.agents/skills/orca-cliis the real directory (canonical-copy) and~/.claude/skills/orca-cliis a symlink resolving into it (provider-alias). Both land in the samemanaged-globalbucket, so freshness dedupes them to one managed install rather than flagging a stray copy.Agent targeting. With several agents detected,
-yinstalls to all of them rather than a user-chosen subset. Those are exactly the provider home roots Orca already scans, and the alternative today is the prompt that hangs.Prompts that simply stop appearing. The "Proceed with installation?" confirm and the one-time "Install the find-skills skill?" offer are skipped; neither installs anything extra.
Tests
The existing shared-module assertion was vacuous — it compared
ORCA_CLI_ORCHESTRATION_SKILL_INSTALL_COMMANDagainstbuildAgentFeatureSkillInstallCommand([...]), i.e. the function against itself, so no change to the command could ever fail it. Replaced with a literal-string assertion, plus a dedicated test pinning both flags and one covering the empty-list throw. Two assertions inCliSkillRuntimeSetup.test.tsxwere tautological the same way (they rebuilt the expectation from the builder they were meant to pin) and are now literals — that pair is the only coverage that the flags survive the native-Windows rewrite.Verified non-vacuous: reverting only the source change makes the shared-module tests fail; restoring it makes them pass.
Assertions updated to pin the new command:
src/shared/agent-feature-install-commands.test.tssrc/renderer/src/components/onboarding/onboarding-feature-setup.test.tssrc/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx(×2)src/renderer/src/components/settings/OrchestrationPane.test.tsxsrc/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx(×2)src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsx(the WSL wrapper surface)src/renderer/src/components/skills/skill-freshness-skipped-reason.test.tssrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxSeveral of those use
toContain, so a superstring would have passed silently; they were tightened so each rendered surface actually proves the flags reach it. Sites left alone are pure local fixtures passed into a component as a prop (AgentSkillSetupPanel.test.tsx,BrowserUseSkillStep.test.tsx) and one invalid-payload rejection fixture (onboarding-feature-setup-validator.test.ts) — none derive from the builder.The update command (
npx skills update <name> --global) is intentionally unchanged:normalizeWindowsSkillUpdateCommandparses it with an anchored regex, and the headless updater already passes--yesitself.Green: the 8 changed test files pass (92 tests). Full
typecheckclean,oxlintandoxfmtclean, max-lines ratchet clean. Broader skills/settings/onboarding sweeps are green too, and CI on this branch is passing.Related issues
~/.agents/skillstarget still not landing under--global, which is a separate decision.Validated in the real app
Run against a dev build of this branch, in an isolated instance (temp
HOME) so every skill genuinely reports Not installed and the install surfaces actually render. CDP owner verified as this worktree's own Electron process before attaching.Settings → Computer Use → Install. This is the reporter's exact path: the command is pasted into a live terminal and left sitting at the prompt ("Press Enter to run the command."), which is why an interactive prompt could strand the session. The pasted command now ends in
-y:Settings → Orchestration → "Prefer your own terminal? Copy install command". The manual-copy dialog carries the flag too:
(Both flags shown above come from this PR.
npx --yesanswers npm's package-install prompt;-yanswers the skills CLI's agent-selection prompt. They are independent, and either one alone still leaves a way to stall.)Not reachable in this environment, so not visually validated: the WSL and native-Windows rewrites (macOS host). Those are covered by unit tests, including a newly pinned assertion on the Windows update→reinstall rewrite.