Skip to content

Install Orca's own skills with Orca's skill installer instead of npx skills - #29196

Closed
Jinwoo-H wants to merge 11 commits into
mainfrom
jinwoo/bundled-skill-installer
Closed

Jinwoo-H wants to merge 11 commits into
mainfrom
jinwoo/bundled-skill-installer

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​777 $\color{#cf222e}{\Huge{\mathbf{−}}}$​961 $\color{#cf222e}{\Huge{\mathbf{−}}}$​184
Prod 41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1594 $\color{#cf222e}{\Huge{\mathbf{−}}}$​824 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​770

ELI5

Orca keeps its own agent skills (orca-cli, orchestration, and so on) up to date. Until now it did that by running a third-party tool, npx [email protected] add, which downloads the whole Orca repository from GitHub just to copy a few small files. That needs a network connection, Git, npm and Node, and it broke in several ways, most recently when Git prints its messages in Korean, German or Italian (#28914). Orca already ships those exact files and already has a careful installer for shared skills, so now it installs its own skills with that installer instead.

What Changed

Before: The Update skills dialog and orca skills install|update ran npx --yes [email protected] add https://github.com/stablyai/orca/tree/<build commit> .... That meant a clone of about 97 MB, a 5-minute timeout, a Windows cmd.exe code path, and failures on translated Git. It also overwrote whatever copy was installed, even one the user had edited.

After: Both paths copy the files this Orca build ships using Orca's existing skill-sharing installer (installSharedExtractedSkill). That installer already handles transactions, crash recovery, receipts, conflict detection and agent-folder links. Nothing is downloaded.

How it works:

  • Where the files come from: pnpm generate:skill-bundle-manifest now also writes src/main/skills/bundled-orca-skill-packages.ts, which embeds each shipped skills/<name> file. A test checks that those bytes hash to exactly the digests in resources/skills/current-manifest.json. The files are embedded in code, the same way the CLI already embeds skill guides, because orca skills install runs on SSH hosts, containers and WSL, where there is no app resources folder.
  • Which copies Orca may replace: the manifest only knows the current version, so Orca needs a list of earlier ones. resources/skills/released-digests.json is a new add-only list of every version Orca has shipped. It was filled from the history of skills/ (--backfill-released-digests; one bounded git log per skill, no scan across all refs, the executable bit read from git ls-tree), and the generator adds each new version. The manifest check now also fails if the list is missing any entry its base branch had, so the list can't shrink.
  • Taking over existing installs: Orca replaces a copy only if two things are true. First, the skills CLI's lock file says it came from stablyai/orca, or Orca's own install record says Orca put it there. Second, its bytes match a version Orca shipped. Anything else is reported as a conflict and left alone. This works both for the shared ~/.agents/skills copy and for the real folder that a single-agent skills add --agent claude-code leaves in ~/.claude/skills. Crash recovery saves the list of matching versions with each install, so an interrupted install still recovers.
  • The lock file is read, never written. For a --local install Orca reads the project's skills-lock.json instead.
  • Install records for Orca's own skills use the id prefix orca_bundled_ and are left out of Skills → Manage installs, so they never offer actions meant for shared cloud packages.
  • orca skills install|update behaviour changes:
    • It runs in-process; the installer loads lazily, so other commands don't pay for it.
    • --agent now only adds agents: agents Orca already installed the skill for always stay targeted, so it can't narrow a later update.
    • --agent takes Orca agent ids (claude, codex, cursor, ...) plus universal. The only old skills-CLI name still accepted is claude-code; other old names such as gemini-cli are rejected with the list of valid ids.
    • With no detected agent it installs into the shared ~/.agents/skills folder only, instead of failing with "No coding agent detected".
    • New --force replaces a copy that has local changes.
    • update (and update --all) only refreshes skills already installed on the machine, including an Orca-owned copy left in an agent folder. It never adds a skill: update --all skips the rest, and update --skill <name> for a missing skill prints <name>: not installed, so not updated. Install it with: orca skills install --skill <name> and exits 1. With nothing installed, update --all prints No Orca skills are installed here, so there is nothing to update. Install one with: orca skills install --skill <name>.
    • Discovery's per-skill [skills] scan … line no longer reaches CLI output. JSON output gains an optional notInstalled list when skills were skipped.
    • --dry-run prints what a run would change: the shared copy, plus each agent folder to link, replace or leave alone. It uses the installer's own replacement rule (skillInstallReplacementAllowed).
    • --json works for real runs. The --dry-run --json output replaces the old command field with plan.
    • Discovery's diagnostic line goes to stderr.
  • An update only ever adds agents: the agents in Orca's install record are always included, so orca skills update --agent codex, or a detection that misses Claude, can no longer unlink ~/.claude/skills/<name>. The flip side: if a user deletes an Orca skill link by hand, the next update recreates it, even for an agent that is no longer installed, because that agent's skills folder is recreated with it.
  • One placement rule: what an install does to each agent folder is decided by a single function (skill-placement-decision.ts). The real run and --dry-run both call it, so the plan can't disagree with the install, e.g. on re-linking a broken link from an earlier install, receipt-owned copies or WSL links.
  • The app's "Update skills" status is the installer's plan. Before, the badge, nudge and Update skills dialog used their own older check, written for npx installs. It disagreed with the installer: for example it marked a single-agent skills add --agent claude-code copy "Skipped — This is a separate copy…" even though the installer would replace it. Now one function, planBundledOrcaSkills (bundled-orca-skill-plan.ts), works out for each Orca skill on this machine what an install does at every location: keep, install, update, link, replace, or leave it with a reason. The reasons are local changes, not installed by Orca, a link Orca does not manage, name in use, read-only, and unreadable. It is built on the same placement rule and skillInstallReplacementAllowed. Every surface reads it:
    • orca skills install|update --dry-run prints it.
    • orca skills update runs it.
    • The app's badge, nudge, dialog rows, preselection and "left as is" sentences come from it.
    • The dialog's Update button re-plans and installs exactly the skills the plan says to update, with no separate eligibility filter. Per-skill results come from planning again after the run.
    • bundledSkillVerdict (src/shared/skill-freshness.ts) is the single reading of a plan:
      • absent: no copy.
      • current: nothing to do.
      • update: an Orca copy exists and the install would write something.
      • attention: only copies Orca leaves as they are.
  • Deleted with it: the npx-era classifier, which includes the plugin-cache scan, plugin manifest roots, installation topology, eligibility, artifact hashing and outcome modules (about 2,000 lines of code and 3,000 lines of tests). It also removes their copy: "Duplicate", "Plugin cache", "In a repo", "Not from Orca", the scan-limit messages and the hover tips.
  • What the dialog no longer shows (by design):
    • Plugin-managed and project/repo copies: the installer never touches them.
    • The "Not from Orca" opt-in: a copy Orca did not install is now listed with its reason and left alone. orca skills update --force is the way to take it over.
    • A newly detected agent now counts as an update, because the install would link it.
    • Nudge dismissals are keyed by skill name, shared path and package digest. That means a dismissal made before this change shows once more.
  • Freshness stays local: it goes over the existing internal IPC to this machine's main process. The web client gets an empty list, as before. There is no RPC or stream change, so mixed client and server versions are unaffected. The inventory's schemaVersion is now 2; only the renderer reads it.
  • CLI update and the plan: orca skills update runs the skills whose verdict is update or current. It reports "attention" skills (exit 1, with a --force hint when that would help) and prints a not-installed line for absent skills (silent with --all). JSON output gains an optional leftAsIs list of plans.
  • Ledger check: on a pull request, the check fails if it can't read the base branch, rather than skipping.
  • Installer cleanups:
    • Installs from files already on disk have their own input type with no archive fields, so no archive hash is invented.
    • When an install replaces any existing copy, the installer reports updated. In skill sharing this means replacing an unowned folder with "replace and discard local" now reads Updated instead of Installed.
    • Stopping an update still re-scans before the dialog returns to idle.
  • Deleted: the npx process code in the updater and the CLI, src/shared/skills-cli-agent-detection.ts, and SKILLS_CLI_ENV_OVERRIDES.

Must merge together with the stacked follow-up PR (opening next): the copy-paste commands in Settings, onboarding and the update dialog's "Copy command" still show npx skills add. Moving them to orca skills install depends on which command name resolves where (orca / orca-ide / ORCA_CLI_COMMAND, Orca terminal vs. external terminal, WSL, remote runtimes) and on removing the Windows npx check, so it gets its own review. Until it lands, the copy-paste text and the new CLI disagree, so the two should ship in the same release. That follow-up also removes skills-cli-agent-keys.ts, the npx command builder and the skill-update round-trip workflow.

Why

Linked Issue

Refs #28914

Visual Proof

App: Update skills dialog on the two npx-era layouts

Both runs used the dev app in a hidden window driven over CDP, with a scratch HOME and profile. Each HOME was arranged by extracting an older Orca release's skills/orca-cli and skills/orchestration, with a stablyai/orca lock entry, the way [email protected] leaves them.

npx shared copy (~/.agents/skills/<name> plus a ~/.claude/skills link). The nudge appears, then the dialog shows Will update for the shared copy, No change for the Claude link, and Will link for the other detected agents:

shared-nudge
shared-dialog-before
shared-dialog-after

On disk after Update: both shared copies have this build's SKILL.md (orca-cli aa76f8650501, orchestration cd1b364bf357), the Claude links are unchanged, the other agents' links were added, and .skill-lock.json was not written (its modified time is still the setup time, in both runs).

npx single-agent copy (skills add --agent claude-code: a real folder in ~/.claude/skills, nothing shared). Before this change the dialog said "Skipped — This is a separate copy…". Now it says Will install for the shared copy and Will replace for the Claude folder:

single-nudge
single-dialog-before
single-dialog-after

On disk after Update (all four are folders):

~/.agents/skills/orca-cli:       folder, SKILL.md aa76f8650501
~/.claude/skills/orca-cli:       folder, SKILL.md aa76f8650501
~/.agents/skills/orchestration:  folder, SKILL.md cd1b364bf357
~/.claude/skills/orchestration:  folder, SKILL.md cd1b364bf357

CLI

Here is the CLI before/after against a scratch HOME (real [email protected] used to install an older Orca release, #19128 / Sep 7):

=== Update a copy the real skills CLI installed (shared folder + Claude link, the layout Orca 1.4.225 wrote) ===
  ~/.agents/skills/orca-cli : folder, SKILL.md b21b9b80475c     <- Sep 7 release
  ~/.claude/skills/orca-cli : link -> ../../.agents/skills/orca-cli
  ~/.agents/.skill-lock.json: sha256 a124b63af9e1
$ orca skills update --skill orca-cli --agent claude --dry-run
orca-cli: would update .../.agents/skills/orca-cli
$ orca skills update --skill orca-cli --agent claude
orca-cli: updated (.../.agents/skills/orca-cli)                  [exit 0]
  ~/.agents/skills/orca-cli : folder, SKILL.md aa76f8650501      <- this build
  ~/.claude/skills/orca-cli : link -> ../../.agents/skills/orca-cli
  lock file byte-identical: true
$ npx [email protected] ls -g  ->  orca-cli ~/.agents/skills/orca-cli  Source: stablyai/orca

  (what [email protected] wrote, hashed the way Orca's installer hashes: f5e4d304469c, which is in released-digests.json and is not this build's version)

=== Single-agent layout (skills add --agent claude-code: real folder in ~/.claude/skills) ===
  before: ~/.agents/skills/orca-cli absent, ~/.claude/skills/orca-cli folder b21b9b80475c
$ orca skills update --skill orca-cli --agent claude --dry-run
orca-cli: would install .../.agents/skills/orca-cli; would replace .../.claude/skills/orca-cli
$ orca skills update --skill orca-cli --agent claude
orca-cli: installed (.../.agents/skills/orca-cli)                [exit 0]
  after:  both copies aa76f8650501, lock file byte-identical: true

=== A copy with local edits ===
$ orca skills update --skill orca-cli --agent claude
orca-cli: not changed, the installed copy has changes Orca did not make
Rerun with --force to replace a copy that has local changes.     [exit 1]
  edited copy untouched: true
$ orca skills update --skill orca-cli --agent claude --force
orca-cli: updated (.../.agents/skills/orca-cli)                  [exit 0]
  lock file byte-identical: true

=== Fresh install ===
$ orca skills install --skill orca-cli --agent claude
orca-cli: installed (.../.agents/skills/orca-cli)   ~/.claude/skills/orca-cli -> ../../.agents/skills/orca-cli
$ (again) orca-cli: already up to date

User-visible text changes:

  • The update dialog's "Show log" now shows one line per skill instead of npx output: <name>: installed|updated|already up to date (<path>), <name>: not changed, the installed copy has changes Orca did not make (also: ...is a link Orca does not manage, ...another file or folder already uses this name), <name>: installed (<path>), but not linked into <paths>, <name>: stopped, <name>: failed (<code>). The dialog headline and error text ("Some skills could not be updated.") are unchanged.
  • orca skills install|update prints the same lines, a --force hint, and new --dry-run lines (would install|update <path>, would link|replace <path>, <name>: would leave <path>, which Orca did not install, would not change, <reason> (<path>)). Help text, --agent values and the --force flag are updated. The docs page section on keeping skills up to date is updated.
  • --dry-run and update now give one reason per left location: <name>: would leave <path>, <reason>, where the reason is one of it has changes Orca did not make, Orca did not install it, it is a link Orca does not manage, another file or folder already uses this name, its folder is read-only or Orca could not read it. This replaces which Orca did not install and would not change, <reason> (<path>).
  • Update skills dialog, per-location chips (new): Will install, Will update, Will link, Will replace, No change, Local changes, Unmanaged link, Name in use. Read only and Inaccessible are kept.
  • Update skills dialog, left-as-is sentences (new, one per reason, shown under the row):
    • "This copy has changes Orca didn’t make, so the update leaves it as it is. Remove it, then reinstall the skill to get Orca’s version."
    • "Orca didn’t install this copy, so the update leaves it as it is. Remove it, then reinstall the skill to use Orca’s version."
    • "This is a link Orca didn’t create, so the update leaves it as it is."
    • "Another file or folder already uses this skill’s name, so the update leaves it as it is."
    • "This location is read-only, so the update can’t change it. Change its permissions to let Orca update it."
    • "Orca couldn’t read this copy, so the update leaves it as it is."
  • Removed from the dialog (34 strings):
    • Chips: Current, Duplicate, External link, Broken link, In a repo, Plugin cache.
    • All hover tips.
    • The "Skipped — …" reasons for read-only, inaccessible, in-repo, plugin-cache, external-link, broken-link and duplicate ("This is a separate copy, so the update won’t reach it…").
    • "Orca left this skill out of the update command."
    • The eight plugin scan-limit messages.
    • "N skills not installed by Orca are unselected."
    • The two "Not from Orca" tips.
  • es/fr/ja/ko/zh have the matching additions and removals.

Testing

  • I manually tested these changes locally (macOS; built CLI against scratch HOMEs, including a real [email protected] install of an older release; script and log in the lane notes)
  • Automated tests added/updated
    • bundled-orca-skill-install.test.ts:
      • fresh install;
      • lock stablyai/orca + an earlier release in CRLF is replaced;
      • lock + an edited copy is a conflict and untouched;
      • an Orca-looking copy with no lock entry or install record is a conflict;
      • Orca's own install record lets it take over an earlier release but not an edit;
      • --force behaviour;
      • the skills CLI link layout is kept;
      • a single-agent real folder is taken over, and an edited one is left alone (install reported as partial);
      • the project lock is read for --local installs;
      • a dry run writes nothing;
      • the lock file is byte-identical after every operation.
    • src/cli/bundled-skill-update-layouts.test.ts runs one table over real on-disk layouts and checks that the app's verdict, --dry-run --json and the real run all agree. It also checks that left paths stay byte-identical and that nothing is left to update afterwards. The layouts:
      • npx shared copy;
      • npx single-agent copy;
      • new-Orca install;
      • new-Orca install with edits;
      • an external link;
      • a broken link;
      • a plugin-managed copy;
      • a read-only folder;
      • a project/repo-scope copy;
      • a WSL alias.
    • bundled-orca-skill-packages.test.ts: the embedded bytes match the manifest digests.
    • Generator test: the version list is add-only and the embedded files match.
    • Rewritten skill-update-run.test.ts and the install/update part of src/cli/skills.test.ts.
  • pnpm tc, check:code-quality:changed, check:process-host-imports, verify:skill-bundle-manifest, and vitest over src/main/skills src/main/ipc src/cli src/shared config/scripts/... pass. One unrelated failure: omp-draft-launch-shell.test.ts (fish shell on this Mac).
  • The in-app Update skills dialog was run end to end on both npx-era layouts (see Visual Proof).
  • Not verified: Windows and Linux runs, and WSL and SSH beyond the CLI running natively on that host.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Mixed versions between paired clients and hosts: no new RPC method, field or message type. The update dialog uses local IPC only, and its SkillUpdateRun shape is unchanged except that the reason unsafe-command-path can no longer happen.
  • SSH / WSL / folder workspaces: the in-app updater still covers only this machine's global homes, as before. orca skills install writes to the homes of the machine it runs on and still refuses when the shell forwards orca to another host.
  • Performance: the installer modules load lazily in the CLI. The embedded files add about 34 KB. The freshness scan keeps its existing cache and focus-triggered rechecks; it now reads a few known paths per skill instead of walking plugin caches.
  • Follow-up: resources/skills/current-manifest.json is no longer read at runtime. It is still checked against the embedded files, so it can be dropped separately.

Checklist

  • This PR is small and focused (split: the copy-paste commands follow in a stacked PR)
  • I explained what changed and why
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (typecheck and targeted tests pass locally; CI covers the rest)

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26519215-50f9-46fd-9a32-f66443443835
📥 Commits

Reviewing files that changed from the base of the PR and between 19323dc and fa14b0d.

📒 Files selected for processing: 1
  • config/scripts/run-node-server-tests.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The change replaces CLI and app skill-update subprocess flows with a bundled installer. It adds generated embedded skill packages and a released-digest ledger, plus install planning and logic for adopting recognized earlier releases. Placement transactions carry adoptable digests through recovery. The CLI supports skill and provider selection, dry runs, JSON output, and force behavior. The runtime update path invokes the installer and uses install results or a disk rescan to report outcomes.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to fa14b

No actionable issue is established for the changed CLI dry-run test; the PR is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 15.05% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 93 functions across 43 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the primary change: Orca now installs its own skills with the built-in installer instead of npx skills.
Description check Passed The description covers the required sections, user-visible behavior, rationale, linked issue, visual proof, testing, compatibility notes, and checklist. It also documents known test and platform limit…
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3f836874-3d7f-44e1-becb-7ee09d7d3cce
📥 Commits

Reviewing files that changed from the base of the PR and between 175deba and 7d16ba9.

📒 Files selected for processing: 21
  • config/scripts/generate-skill-bundle-manifest.mjs
  • config/scripts/generate-skill-bundle-manifest.test.mjs
  • config/tsconfig.cli.json
  • resources/skills/released-digests.json
  • src/cli/bundled-skill-install-parity.test.ts
  • src/cli/handlers/bundled-skill-install-command.ts
  • src/cli/skills.test.ts
  • src/main/skills/bundled-orca-skill-install.test.ts
  • src/main/skills/bundled-orca-skill-install.ts
  • src/main/skills/bundled-orca-skill-packages.test.ts
  • src/main/skills/bundled-orca-skill-packages.ts
  • src/main/skills/bundled-orca-skill-plan.ts
  • src/main/skills/discovery.ts
  • src/main/skills/skill-install-discovery-verification.ts
  • src/main/skills/skill-install-provenance.ts
  • src/main/skills/skill-install-service.ts
  • src/main/skills/skill-install-transaction-result.ts
  • src/main/skills/skill-install-transaction.test.ts
  • src/main/skills/skill-install-transaction.ts
  • src/main/skills/skill-update-run.test.ts
  • src/main/skills/skill-update-run.ts
💤 Files with no reviewable changes: 1
  • resources/skills/released-digests.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment on lines +38 to +74
async function planPlacement(
prepared: PreparedBundledSkill,
destinationPath: string
): Promise<BundledOrcaSkillPlacementPlan['action']> {
const stat = await lstat(destinationPath).catch(() => null)
if (!stat) {
return 'link'
}
const [resolvedDestination, resolvedCanonical] = await Promise.all([
realpath(destinationPath).catch(() => null),
realpath(prepared.canonicalPath).catch(() => prepared.canonicalPath)
])
if (
resolvedDestination &&
normalizedPath(resolvedDestination) === normalizedPath(resolvedCanonical)
) {
return 'keep'
}
if (stat.isSymbolicLink()) {
return 'skip'
}
const filesystem = prepared.request.filesystem ?? nativeSkillInstallFilesystem
const observed = await filesystem
.observeSkill(destinationPath, prepared.manifest.files)
.catch(() => null)
if (!observed) {
return 'skip'
}
if (observed.observedDigest === prepared.manifest.packageDigest) {
return 'keep'
}
const ownedDigests = [
...(prepared.local.adoptableDigests ?? []),
...(prepared.receipt ? [prepared.receipt.packageDigest] : [])
]
return ownedDigests.includes(observed.observedDigest) ? 'replace' : 'skip'
}

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '38,120p' src/main/skills/bundled-orca-skill-plan.ts
rg -n 'adoptableDigests|matching|digest|unchanged' src/main/skills/skill-placement-reconciliation.ts src/main/skills/skill-placement-copy.ts

Repository: stablyai/orca

Length of output: 4260


🏁 Script executed:

set -e
printf '%s\n' '--- reconciliation ---'
nl -ba src/main/skills/skill-placement-reconciliation.ts | sed -n '1,290p'
printf '%s\n' '--- placement copy ---'
nl -ba src/main/skills/skill-placement-copy.ts | sed -n '1,180p'
printf '%s\n' '--- references to reconciliation/install placement ---'
rg -n -F --glob '*.ts' -e 'reconcileSkillPlacement' -e 'inspectSkillCanonicalState' -e 'skillInstallReplacementAllowed' -e 'observeSkill(' -e 'action ===' src/main/skills src/cli | sed -n '1,260p'
printf '%s\n' '--- relevant tests ---'
rg -n -F --glob '*.{test,spec}.ts' -e 'packageDigest' -e 'adoptableDigests' -e 'placement' -e 'unowned' -e 'conflict' -e 'keep' src/main/skills src/cli | sed -n '1,320p'

Repository: stablyai/orca

Length of output: 41359


🏁 Script executed:

set -e
printf '%s\n' '--- bundled reconciliation callers and input construction ---'
rg -n -F --glob '*.ts' -e 'reconcileSkillProviderPlacement(' -e 'adoptableDigests:' -e 'releasedDigests' -e 'planBundledOrcaSkills(' -e 'installBundledOrca' -e 'bundled-orca-skill-plan' src/main/skills src/cli | sed -n '1,360p'
printf '%s\n' '--- bundled plan implementation ---'
nl -ba src/main/skills/bundled-orca-skill-plan.ts | sed -n '1,190p'
printf '%s\n' '--- installer/service blocks ---'
rg -n -F --glob '*.ts' -e 'reconcileSkillProviderPlacement' src/main/skills | cut -d: -f1 | sort -u | while read -r f; do echo \"### $f\"; rg -n -F -C 24 'reconcileSkillProviderPlacement' \"$f\"; done
printf '%s\n' '--- focused planner and bundled install tests ---'
for f in src/main/skills/bundled-orca-skill-plan.test.ts src/main/skills/bundled-orca-skill-install.test.ts src/main/skills/skill-placement-reconciliation.test.ts; do
  if test -f \"$f\"; then echo \"### $f\"; nl -ba \"$f\" | sed -n '1,340p'; fi
done

Repository: stablyai/orca

Length of output: 41806


🏁 Script executed:

set -e
printf '%s\n' '--- bundled installer ---'
nl -ba src/main/skills/bundled-orca-skill-install.ts | sed -n '1,290p'
printf '%s\n' '--- bundled install and plan tests ---'
nl -ba src/main/skills/bundled-orca-skill-install.test.ts | sed -n '1,330p'
printf '%s\n' '--- provenance and lock ownership definitions ---'
rg -n -F --glob '*.ts' -e 'owned =' -e 'const owned' -e 'previousReceipt' -e 'readSkillInstallReceipt' -e 'readSkillInstallLock' -e 'lock' src/main/skills/bundled-orca-skill-install.ts src/main/skills/skill-install-provenance.ts src/main/skills/skill-install-lock.ts src/main/skills | sed -n '1,260p'

Repository: stablyai/orca

Length of output: 42319


🏁 Script executed:

set -e
printf '%s\n' '--- install service ---'
nl -ba src/main/skills/skill-install-service.ts | sed -n '60,125p'
printf '%s\n' '--- placement transaction ---'
nl -ba src/main/skills/skill-placement-transaction.ts | sed -n '165,215p'
printf '%s\n' '--- CLI bundled install route ---'
nl -ba src/cli/handlers/bundled-skill-install-command.ts | sed -n '195,235p'

Repository: stablyai/orca

Length of output: 6747


Require ownership before reporting a matching provider copy as keep.

When a provider folder has the current bundled bytes but no Orca lock entry or receipt, the dry-run returns keep. The installer passes no adoptableDigests, so reconciliation reports skill-placement-unowned and leaves the folder unchanged. The dry-run therefore does not describe the actual result.

Suggested fix
-  if (observed.observedDigest === prepared.manifest.packageDigest) {
+  if (
+    observed.observedDigest === prepared.manifest.packageDigest &&
+    (prepared.local.adoptableDigests?.length ?? 0) > 0
+  ) {
     return 'keep'
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async function planPlacement(
prepared: PreparedBundledSkill,
destinationPath: string
): Promise<BundledOrcaSkillPlacementPlan['action']> {
const stat = await lstat(destinationPath).catch(() => null)
if (!stat) {
return 'link'
}
const [resolvedDestination, resolvedCanonical] = await Promise.all([
realpath(destinationPath).catch(() => null),
realpath(prepared.canonicalPath).catch(() => prepared.canonicalPath)
])
if (
resolvedDestination &&
normalizedPath(resolvedDestination) === normalizedPath(resolvedCanonical)
) {
return 'keep'
}
if (stat.isSymbolicLink()) {
return 'skip'
}
const filesystem = prepared.request.filesystem ?? nativeSkillInstallFilesystem
const observed = await filesystem
.observeSkill(destinationPath, prepared.manifest.files)
.catch(() => null)
if (!observed) {
return 'skip'
}
if (observed.observedDigest === prepared.manifest.packageDigest) {
return 'keep'
}
const ownedDigests = [
...(prepared.local.adoptableDigests ?? []),
...(prepared.receipt ? [prepared.receipt.packageDigest] : [])
]
return ownedDigests.includes(observed.observedDigest) ? 'replace' : 'skip'
}
async function planPlacement(
prepared: PreparedBundledSkill,
destinationPath: string
): Promise<BundledOrcaSkillPlacementPlan['action']> {
const stat = await lstat(destinationPath).catch(() => null)
if (!stat) {
return 'link'
}
const [resolvedDestination, resolvedCanonical] = await Promise.all([
realpath(destinationPath).catch(() => null),
realpath(prepared.canonicalPath).catch(() => prepared.canonicalPath)
])
if (
resolvedDestination &&
normalizedPath(resolvedDestination) === normalizedPath(resolvedCanonical)
) {
return 'keep'
}
if (stat.isSymbolicLink()) {
return 'skip'
}
const filesystem = prepared.request.filesystem ?? nativeSkillInstallFilesystem
const observed = await filesystem
.observeSkill(destinationPath, prepared.manifest.files)
.catch(() => null)
if (!observed) {
return 'skip'
}
if (
observed.observedDigest === prepared.manifest.packageDigest &&
(prepared.local.adoptableDigests?.length ?? 0) > 0
) {
return 'keep'
}
const ownedDigests = [
...(prepared.local.adoptableDigests ?? []),
...(prepared.receipt ? [prepared.receipt.packageDigest] : [])
]
return ownedDigests.includes(observed.observedDigest) ? 'replace' : 'skip'
}

The packaged CLI could only load main modules built as electron-vite entries,
so add one entry that re-exports the installer and unpack it with the CLI.
Isolate the manifest tests from the CI pull_request env, and make the orcad
artifact check plan orca-cli in a scratch home instead of expecting the old
npx source URL.

Co-Authored-By: Claude <[email protected]>

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Stop the bundled install loop when cancellation starts. · bundled-orca-skill-install.ts:198-215

src/main/skills/bundled-orca-skill-install.ts:198-215
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Stop the bundled install loop when cancellation starts.

When input.signal aborts during one entry, the loop still calls prepareBundledSkill for later entries. Those calls can create extraction directories and write temporary files before installSharedExtractedSkill observes the aborted signal. Add an abort check before preparing each entry so cancellation does not stage the remaining batch.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f74fc040-85ea-4f2a-8996-59c8af83d9d5
📥 Commits

Reviewing files that changed from the base of the PR and between 70c5888 and 19323dc.

📒 Files selected for processing: 8
  • config/build-plugins/plain-node-entry-guard.ts
  • config/electron-builder.config.cjs
  • config/scripts/electron-builder-config.test.mjs
  • config/scripts/generate-skill-bundle-manifest.test.mjs
  • config/scripts/run-node-server-tests.mjs
  • config/tsconfig.cli.json
  • src/cli/handlers/bundled-skill-install-command.ts
  • src/main/skills/bundled-orca-skill-cli-entry.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Jinwoo-H and others added 4 commits October 15, 2026 21:02
orca skills update (and --all) now refreshes only skills already installed
here, including an Orca-owned copy in an agent home, and points at install
for the rest. Discovery's per-skill scan line no longer reaches the CLI.

Co-Authored-By: Claude <[email protected]>
The app judged Orca's skills with its own classifier of skill folders, written
for the npx era, so a skills CLI single-agent install (a real folder in
~/.claude/skills, no shared copy) read as a "separate copy" and was skipped,
while `orca skills update` updated it. Now one plan, built on the installer's
own placement decision and replacement rule, says what an install does to each
location, with a reason for every location it leaves. `orca skills --dry-run`,
`orca skills update`, and the app's badge, nudge, Update skills dialog and Update
run all read it, and a re-plan after the run is each skill's outcome.

The freshness inventory, eligibility filter, topology classifier, plugin-cache
scan and their copy are deleted. A table-driven test runs the app verdict, the
CLI dry run and the run itself over real layouts.

Co-Authored-By: Claude <[email protected]>
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Superseded by #31662, #31688, #31867 and #31918, which are now merged.

@Jinwoo-H Jinwoo-H closed this Oct 23, 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.

1 participant