Skip to content

fix(skills): pass -y so the pasted skill install never stalls on a prompt - #11254

Closed
brennanb2025 wants to merge 6 commits into
mainfrom
brennanb2025/Skill-install-y-flag
Closed

brennanb2025 wants to merge 6 commits into
mainfrom
brennanb2025/Skill-install-y-flag

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #9567

The bug

buildAgentFeatureSkillInstallCommand in src/shared/agent-feature-install-commands.ts produces the command that every Settings and onboarding skill card pastes into a terminal:

npx skills add https://github.com/stablyai/orca --skill <names> --global

That command is pasted, not auto-run — OnboardingInlineCommandTerminal.tsx dispatches PASTE_TERMINAL_TEXT_EVENT with command.trim() and no trailing newline, into a session whose cwd is $HOME.

It could stall on prompts from two separate programs — npm and the skills CLI — and either one strands the user. Closing the panel then tears the PTY down mid-prompt — which is exactly the reporter's session-killed: immediate: true / exit 1.

  1. npm's own prompt. npx skills … without --yes blocks on Need 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: missingFromTree documents 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.

  2. The skills CLI's own prompts. Without -y the CLI blocks before it finishes, and it does so for every user — not only the multi-agent case in the report. The Proceed with installation? confirm is gated on !options.yes alone. The "Installation method" select fires even when exactly one agent is installed, because the CLI calls ensureUniversalAgents and appends its universal .agents/skills targets to the detected agent's own dir, making uniqueDirs.size > 1. That set is built from each agent's relative skillsDir, 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 -y the run stops rendering at ◆ Installation method and waits; adding -y alone takes the identical command through to Installed 1 skill / Done!. (The CLI sets options.yes = true by 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.tsx wrap this same string rather than rebuilding it:

  • the WSL base64 login-shell wrapper, and
  • the native-Windows update → reinstall rewrite (normalizeWindowsSkillUpdateCommand), which calls buildAgentFeatureSkillInstallCommand and so now also yields a non-interactive command.
-npx skills add https://github.com/stablyai/orca --skill <names> --global
+npx --yes skills add https://github.com/stablyai/orca --skill <names> --global -y

The two flags are distinct and both load-bearing, which is already the established pattern in this repo: src/main/skills/skill-update-run.ts spawns ['--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.tsx passes freshnessSkillName={undefined} when the runtime is wsl, 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.

--global is deliberately kept

A prior proposal (#6580) suggested dropping --global. That premise does not hold on current main: src/main/skills/skill-discovery-sources.ts deliberately 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 --global writes there — the in-repo comment states that intent explicitly. Removing it would narrow discovery coverage.

What -y auto-accepts, and why none of it regresses Orca

  • Install method (symlink vs copy). -y skips 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: classifyHomeSkillTopology returns provider-alias for a link into ~/.agents/skills, and topologyDedupeBucket buckets provider-alias together with canonical-copy as managed-global. So a symlinked install is treated as managed, not as a modified or unmanaged copy.

    Confirmed on disk after a real -y install: ~/.agents/skills/orca-cli is the real directory (canonical-copy) and ~/.claude/skills/orca-cli is a symlink resolving into it (provider-alias). Both land in the same managed-global bucket, so freshness dedupes them to one managed install rather than flagging a stray copy.

  • Agent targeting. With several agents detected, -y installs 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_COMMAND against buildAgentFeatureSkillInstallCommand([...]), 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 in CliSkillRuntimeSetup.test.tsx were 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.ts
  • src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts
  • src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx (×2)
  • src/renderer/src/components/settings/OrchestrationPane.test.tsx
  • src/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.ts
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx

Several 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: normalizeWindowsSkillUpdateCommand parses it with an anchored regex, and the headless updater already passes --yes itself.

Green: the 8 changed test files pass (92 tests). Full typecheck clean, oxlint and oxfmt clean, max-lines ratchet clean. Broader skills/settings/onboarding sweeps are green too, and CI on this branch is passing.

Related issues

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:

npx --yes skills add https://github.com/stablyai/orca --skill computer-use --global -y

yflag-install-terminal.png

Settings → Orchestration → "Prefer your own terminal? Copy install command". The manual-copy dialog carries the flag too:

npx --yes skills add https://github.com/stablyai/orca --skill orchestration --global -y

yflag-copy-dialog.png

(Both flags shown above come from this PR. npx --yes answers npm's package-install prompt; -y answers 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.

…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-apps

greptile-apps Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

This 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 skills package, and once from the skills CLI itself asking about install method/agent selection — leaving the session hung until the user closes the panel, which kills it with exit 1.

The fix is a one-line change to buildAgentFeatureSkillInstallCommand in src/shared/agent-feature-install-commands.ts, adding --yes to the npx invocation and -y to the skills CLI call. All call sites (WSL wrapper, Windows reinstall rewrite, freshness-skipped-reason message) inherit the flags automatically since they all pass through this single builder.

  • The core change is minimal and surgical: one line in agent-feature-install-commands.ts adding npx --yes and -y, matching the pattern already used in the headless skill-update-run.ts spawner.
  • Eight test files are updated to use literal-string assertions instead of re-deriving the expected value from the builder being tested, making those tests genuinely non-vacuous for the first time and catching any future regression to the command shape.
  • A new dedicated test explicitly pins both non-interactive flags and guards the empty-list throw behavior.

Confidence Score: 5/5

Safe 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 (npx --yes and skills -y) are already used in skill-update-run.ts for the headless updater, so they are a known-safe pattern in this codebase. Eight test files are updated from vacuous self-referential assertions to pinned literals, making regressions detectable going forward.

Files Needing Attention: No files require special attention. The OrchestrationPane.test.tsx aliasing of UPDATE_COMMAND = INSTALL_COMMAND is intentional for the Windows reinstall-rewrite path and is correct.

Important Files Changed

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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The shared skill installation command builder now generates non-interactive global installation commands using npx --yes and -y. Tests add coverage for single-skill, multi-skill, exported-constant, and empty-input behavior. Renderer tests update expected installation, clipboard, reinstall, orchestration, sidebar, and Windows runtime command strings.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed, but it misses required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections: Summary, Screenshots (or 'No visual change'), Testing checklist, AI Review Report with cross-platform coverage, Security Audit, and Notes.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The command builder and affected surfaces now add -y, matching #9567's non-interactive install requirement.
Out of Scope Changes check ✅ Passed The diff stays focused on the install-command fix and related tests, with no obvious unrelated changes.
Title check ✅ Passed The title clearly summarizes the main change: adding -y to non-interactive skill install commands to prevent prompts from stalling.
✨ 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.

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.

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/shared/agent-feature-install-commands.ts (1)

15-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep 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

📥 Commits

Reviewing files that changed from the base of the PR and between d03510e and dfddaa6.

📒 Files selected for processing (9)
  • src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts
  • src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx
  • src/renderer/src/components/settings/OrchestrationPane.test.tsx
  • src/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsx
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
  • src/renderer/src/components/skills/skill-freshness-skipped-reason.test.ts
  • src/shared/agent-feature-install-commands.test.ts
  • src/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.
brennanb2025 added a commit to scastanoh21/orca that referenced this pull request Jul 29, 2026
… 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.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing this — the premise is wrong, and the evidence for that was already on #9567 before I opened it.

OrcaWin said on that issue, the day it was filed:

We actually want that step to stay interactive so you can choose which agents to install a skill for — so before we change anything, could you help us pin down where it broke for you?

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 skills CLI (v1.5.20) confirms the prompts cover real user choices rather than noise:

  • Scope (Project/Global) is already suppressed, because Orca passes --global explicitly. That is the one decision Orca legitimately owns.
  • Agent selection and Symlink vs Copy are the user's. -y silently answers both.
  • Worse, with zero detected agents, -y takes targetAgents = validAgents (cli.mjs:3731) and writes into every known agent home — reachable from onboarding by a first-run user who has not installed an agent yet, which is exactly where that Install card lives.

The CLI also already handles the case that matters for automation: when it detects it is running inside an agent it sets options.yes and scopes options.agent to the detected agent plus the universal target (cli.mjs:3966), so there is no fan-out on that path and no flag is needed.

The npx --yes half of this PR was defensible on its own — npm's "Ok to proceed?" offers nothing to configure and recurs whenever upstream publishes. But it is not worth carrying alone, because #10453's preflight gates on ^npx\s+skills\s+(?:add|update)\b, which does not match npx --yes skills add .... Landing it would have silently disabled the Windows npx-missing guidance for both install and update.

#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 OrcaWin asked are still the fastest way to settle which of three things actually broke: the user never pressed Enter, the prompt was not navigable in the embedded terminal, or the panel tore down the session mid-prompt.

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]: Settings "Install" reports success when the skill install command exits 1, and Re-check never re-runs it

1 participant