Repository navigation
Conversation
…skills Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
|
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
…lds for staged installs Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3f836874-3d7f-44e1-becb-7ee09d7d3cce
📒 Files selected for processing: 21
config/scripts/generate-skill-bundle-manifest.mjsconfig/scripts/generate-skill-bundle-manifest.test.mjsconfig/tsconfig.cli.jsonresources/skills/released-digests.jsonsrc/cli/bundled-skill-install-parity.test.tssrc/cli/handlers/bundled-skill-install-command.tssrc/cli/skills.test.tssrc/main/skills/bundled-orca-skill-install.test.tssrc/main/skills/bundled-orca-skill-install.tssrc/main/skills/bundled-orca-skill-packages.test.tssrc/main/skills/bundled-orca-skill-packages.tssrc/main/skills/bundled-orca-skill-plan.tssrc/main/skills/discovery.tssrc/main/skills/skill-install-discovery-verification.tssrc/main/skills/skill-install-provenance.tssrc/main/skills/skill-install-service.tssrc/main/skills/skill-install-transaction-result.tssrc/main/skills/skill-install-transaction.test.tssrc/main/skills/skill-install-transaction.tssrc/main/skills/skill-update-run.test.tssrc/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.
| 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' | ||
| } |
There was a problem hiding this comment.
🎯 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.tsRepository: 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
doneRepository: 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.
| 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' | |
| } |
…sion with --dry-run Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
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]>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 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 winStop the bundled install loop when cancellation starts.
When
input.signalaborts during one entry, the loop still callsprepareBundledSkillfor later entries. Those calls can create extraction directories and write temporary files beforeinstallSharedExtractedSkillobserves 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
📒 Files selected for processing: 8
config/build-plugins/plain-node-entry-guard.tsconfig/electron-builder.config.cjsconfig/scripts/electron-builder-config.test.mjsconfig/scripts/generate-skill-bundle-manifest.test.mjsconfig/scripts/run-node-server-tests.mjsconfig/tsconfig.cli.jsonsrc/cli/handlers/bundled-skill-install-command.tssrc/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.
Co-Authored-By: Claude <[email protected]>
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]>
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|updaterannpx --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 Windowscmd.execode 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:
pnpm generate:skill-bundle-manifestnow also writessrc/main/skills/bundled-orca-skill-packages.ts, which embeds each shippedskills/<name>file. A test checks that those bytes hash to exactly the digests inresources/skills/current-manifest.json. The files are embedded in code, the same way the CLI already embeds skill guides, becauseorca skills installruns on SSH hosts, containers and WSL, where there is no app resources folder.resources/skills/released-digests.jsonis a new add-only list of every version Orca has shipped. It was filled from the history ofskills/(--backfill-released-digests; one boundedgit logper skill, no scan across all refs, the executable bit read fromgit 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.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/skillscopy and for the real folder that a single-agentskills add --agent claude-codeleaves in~/.claude/skills. Crash recovery saves the list of matching versions with each install, so an interrupted install still recovers.--localinstall Orca reads the project'sskills-lock.jsoninstead.orca_bundled_and are left out of Skills → Manage installs, so they never offer actions meant for shared cloud packages.orca skills install|updatebehaviour changes:--agentnow only adds agents: agents Orca already installed the skill for always stay targeted, so it can't narrow a later update.--agenttakes Orca agent ids (claude,codex,cursor, ...) plusuniversal. The only old skills-CLI name still accepted isclaude-code; other old names such asgemini-cliare rejected with the list of valid ids.~/.agents/skillsfolder only, instead of failing with "No coding agent detected".--forcereplaces a copy that has local changes.update(andupdate --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 --allskips the rest, andupdate --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 --allprintsNo Orca skills are installed here, so there is nothing to update. Install one with: orca skills install --skill <name>.[skills] scan …line no longer reaches CLI output. JSON output gains an optionalnotInstalledlist when skills were skipped.--dry-runprints 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).--jsonworks for real runs. The--dry-run --jsonoutput replaces the oldcommandfield withplan.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.skill-placement-decision.ts). The real run and--dry-runboth 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.skills add --agent claude-codecopy "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 andskillInstallReplacementAllowed. Every surface reads it:orca skills install|update --dry-runprints it.orca skills updateruns it.bundledSkillVerdict(src/shared/skill-freshness.ts) is the single reading of a plan:orca skills update --forceis the way to take it over.schemaVersionis now 2; only the renderer reads it.orca skills updateruns the skills whose verdict is update or current. It reports "attention" skills (exit 1, with a--forcehint when that would help) and prints a not-installed line for absent skills (silent with--all). JSON output gains an optionalleftAsIslist of plans.updated. In skill sharing this means replacing an unowned folder with "replace and discard local" now reads Updated instead of Installed.src/shared/skills-cli-agent-detection.ts, andSKILLS_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 toorca skills installdepends 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 removesskills-cli-agent-keys.ts, the npx command builder and the skill-update round-trip workflow.Why
npx skillswith a bare name, so any unrelatedskillsbinary on PATH shadows the npm package #18687), missing Node on SSH or bare hosts, and the 5-minute clone timeout all go away together.stablyai/orca: that would silently overwrite the user's edits.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-cliandskills/orchestration, with astablyai/orcalock entry, the way[email protected]leaves them.npx shared copy (
~/.agents/skills/<name>plus a~/.claude/skillslink). 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:On disk after Update: both shared copies have this build's
SKILL.md(orca-cliaa76f8650501, orchestrationcd1b364bf357), the Claude links are unchanged, the other agents' links were added, and.skill-lock.jsonwas 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:On disk after Update (all four are folders):
CLI
Here is the CLI before/after against a scratch
HOME(real[email protected]used to install an older Orca release, #19128 / Sep 7):User-visible text changes:
<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|updateprints the same lines, a--forcehint, and new--dry-runlines (would install|update <path>,would link|replace <path>,<name>: would leave <path>, which Orca did not install,would not change, <reason> (<path>)). Help text,--agentvalues and the--forceflag are updated. The docs page section on keeping skills up to date is updated.--dry-runand update now give one reason per left location:<name>: would leave <path>, <reason>, where the reason is one ofit 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-onlyorOrca could not read it. This replaceswhich Orca did not installandwould not change, <reason> (<path>).Testing
[email protected]install of an older release; script and log in the lane notes)bundled-orca-skill-install.test.ts:stablyai/orca+ an earlier release in CRLF is replaced;--forcebehaviour;--localinstalls;src/cli/bundled-skill-update-layouts.test.tsruns one table over real on-disk layouts and checks that the app's verdict,--dry-run --jsonand the real run all agree. It also checks that left paths stay byte-identical and that nothing is left to update afterwards. The layouts:bundled-orca-skill-packages.test.ts: the embedded bytes match the manifest digests.skill-update-run.test.tsand the install/update part ofsrc/cli/skills.test.ts.pnpm tc,check:code-quality:changed,check:process-host-imports,verify:skill-bundle-manifest, and vitest oversrc/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).Review
Agent skill upstream boundary
Notes
SkillUpdateRunshape is unchanged except that the reasonunsafe-command-pathcan no longer happen.orca skills installwrites to the homes of the machine it runs on and still refuses when the shell forwardsorcato another host.resources/skills/current-manifest.jsonis no longer read at runtime. It is still checked against the embedded files, so it can be dropped separately.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (typecheck and targeted tests pass locally; CI covers the rest)