Repository navigation
feat(skills): run skill updates in the background without a terminal - #10843
Conversation
|
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:
📝 WalkthroughWalkthroughAdds a validated skill update runner with inventory-based outcome detection, cancellation, output handling, and lifecycle state. Wires the runner through main-process IPC and preload APIs, including a web fallback. Replaces the freshness dialog’s terminal flow with run-state-driven progress, results, logs, retry, and cancellation UI. Adds renderer state storage, grouped skill rows, localized copy, and a status-bar indicator for ongoing and completed updates. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (6)
src/main/skills/skill-update-run.ts (2)
77-83: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSwallowed spawn-resolution failure is reported as
invalid-names.A
getSpawnArgsForWindowsthrow is a launcher-resolution problem, not bad input; the caller and UI will blame the skill names, and the underlying error is discarded. At minimum log it before returning.♻️ Suggested change
try { ;({ spawnCmd, spawnArgs } = getSpawnArgsForWindows(npxCommand, npxArgs)) - } catch { + } catch (error) { + console.error('[skill-update] failed to resolve npx spawn args:', error) return { started: false, reason: 'invalid-names' } }
97-107: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueDecode chunks with a stateful decoder.
chunk.toString('utf8')perdataevent can split a multi-byte character (and an ANSI sequence) across chunks, leaking replacement chars/raw escapes into the displayed log.new StringDecoder('utf8')per stream keeps the tail intact.src/main/skills/skill-update-run.test.ts (1)
116-130: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winNo case emits
closeaftererror.The real ENOENT sequence is
errorthenclose; emitting onlyerrorhides the double-settle path inSkillUpdateRunner.settle. Addingchild.emit('close', null)after the error emit here would pin the one-shot behaviour.src/main/ipc/skills.ts (1)
58-63: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winValidate element types, not just the array.
Array.isArraylets a non-string element through;canonicalizeSkillUpdateNamessorts withlocaleCompare, which throws on a non-string and rejects the invoke instead of returning{ started: false, reason: 'invalid-names' }. The neighbouringskills:discoverhandler already validates with a schema.♻️ Suggested change
- return runner.start(Array.isArray(names) ? names : []) + return runner.start( + Array.isArray(names) ? names.filter((name): name is string => typeof name === 'string') : [] + )src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx (1)
250-277: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winRetry is asserted present but never exercised.
findButton('Retry')only checks rendering. Clicking it and assertingstartUpdateRunis called withfailedNames(['orchestration'], not the fullnames) would pin the one behaviour that distinguishes retry from a fresh run.src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx (1)
112-175: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: extract the run headline into its own component.
This PR already pulled
SummaryHeadlineandSkillUpdateResultRowsinto sibling modules; aRunHeadline({ run, summaryKind, eligibleCount, blockedCount })would apply the same split to this ~60-line IIFE and keep the dialog body readable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 07f1335c-0363-43a8-9e42-cf481c5c76bf
📥 Commits
Reviewing files that changed from the base of the PR and between dad3e3c and a109a03283d1cea0535939805a25bb9c768ebb49.
📒 Files selected for processing (22)
src/main/ipc/skills.tssrc/main/skills/skill-update-run.test.tssrc/main/skills/skill-update-run.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsxsrc/renderer/src/components/skills/skill-freshness-group.tsxsrc/renderer/src/components/skills/skill-freshness-summary-headline.tsxsrc/renderer/src/components/skills/skill-update-result-rows.tsxsrc/renderer/src/components/skills/skill-update-run-store.tssrc/renderer/src/components/status-bar/SkillUpdateStatusSegment.test.tsxsrc/renderer/src/components/status-bar/SkillUpdateStatusSegment.tsxsrc/renderer/src/components/status-bar/StatusBar.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/web/web-preload-api.tssrc/shared/skill-freshness.ts
| if (showResult) { | ||
| void acknowledgeSkillUpdateRun() | ||
| } | ||
| notifyInstalledAgentSkillsChanged() | ||
| } | ||
|
|
||
| const handleTerminalInteraction = ( | ||
| method: 'keyboard' | 'pointer', | ||
| event?: KeyboardEvent<HTMLElement> | ||
| ): void => { | ||
| if (method === 'keyboard' && event?.key === 'Enter') { | ||
| terminalSubmittedRef.current = true | ||
| } | ||
| const handleUpdate = (): void => { | ||
| void startSkillUpdateRun(eligibleNames) | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Unhandled rejections if the update-run IPC calls fail.
startSkillUpdateRun and acknowledgeSkillUpdateRun just await window.api.skills.* and propagate; void here discards the promise without a rejection handler, so a failing IPC call surfaces as an unhandled rejection rather than anything actionable. Prefer catching at the store (so every caller benefits) or at least logging here.
Note: this differs from the fetchKeybindings() case, which already catches internally.
🛡️ Proposed fix in `skill-update-run-store.ts`
export async function acknowledgeSkillUpdateRun(): Promise<void> {
- await window.api.skills.acknowledgeUpdateRun()
+ try {
+ await window.api.skills.acknowledgeUpdateRun()
+ } catch (error) {
+ console.error('Failed to acknowledge skill update run', error)
+ }
}Source: Learnings
The Update skills dialog had no primary action at all — its footer was only Re-check and Close, and the real action was a pre-filled command in an embedded PTY that the user had to press Enter on. Orca already builds and validates that command, so it now runs it. - Add a headless runner for `npx --yes skills update <names> --global -y`. Both --yes flags are load-bearing: npx's skips the package-install prompt, and the skills CLI's takes its own non-interactive branch. stdin is ignored so `process.stdin.isTTY` stays falsy, which is the other half of that gate. - Own the run in main so closing the dialog backgrounds it instead of killing it, and surface it in the status bar: spinner while running, a green check on success that clears itself, and a failure that persists until acted on. - Derive per-skill outcomes by re-scanning the freshness inventory after exit rather than parsing stdout. `skills update` has no --json (that flag exists only on `list`) and reports progress per-source, not per-skill, so the run bar is deliberately indeterminate instead of faking a percentage. When the re-scan has a verdict it outranks the exit code. - Drop the version trail from the rows and surface the skill list and skip reasons directly instead of hiding them behind a disclosure. Also fixes a width bug the collapsed disclosure used to hide: deep plugin-cache paths set the dialog's width and pushed the footer actions off-screen.
a109a03 to
2384c79
Compare
|
Rebased onto Two notes on CI, since this PR touches
|
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/main/skills/skill-update-run.ts (1)
109-156: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
settlestill lacks a one-shot latch —errorthencloseboth pass the guard.Same issue flagged on a prior commit of this file:
settleonly checksthis.run.state !== 'running'on entry, but state doesn't flip out of'running'until the asyncrescan(...).then(finish)resolves. When spawn fails, Node emitserrorthenclose; both calls tosettleseestate === 'running', so both proceed — rescanning twice and letting theclosemessage (skills update exited with code null) overwrite the realspawnError(e.g.spawn ENOENT) the user needs to see.🩺 Suggested fix: add a settling latch
private settle(names: string[], spawnError: string | null): void { - if (this.run.state !== 'running') { + if (this.run.state !== 'running' || this.settling) { return } + this.settling = true this.child = nullClear
this.settling = falsewherever'running'is next published (start ofstart()) and incancel().
🧹 Nitpick comments (2)
src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx (1)
152-156: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
emitRunsilently no-ops when the dialog never subscribed.
pushRun?.(run)swallows a missing subscription, so a regression inonUpdateRunwiring shows up as confusing text assertions instead of a clear failure.♻️ Assert the subscription exists
async function emitRun(run: SkillUpdateRun): Promise<void> { + expect(pushRun, 'expected the dialog to subscribe to update-run events').not.toBeNull() await act(async () => { pushRun?.(run) }) }src/main/skills/skill-update-run.ts (1)
88-117: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winNo timeout on the spawned
skills updateprocess.If the child hangs (network stall, prompt the CLI unexpectedly emits despite the non-interactive gate, etc.), the run stays in
'running'forever with no automatic recovery — only a manualcancel()from the UI can unstick it. Consider adding a watchdog timeout that kills the child and settles the run with a clear timeout message.♻️ Sketch of a watchdog timeout
this.child = child + + const timeout = setTimeout(() => { + child.kill() + this.settle(canonicalNames, 'skills update timed out') + }, UPDATE_TIMEOUT_MS) + child.once('close', () => clearTimeout(timeout))
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 46ab867a-db3e-461e-97f6-6fb6c60b21e0
📥 Commits
Reviewing files that changed from the base of the PR and between a109a03283d1cea0535939805a25bb9c768ebb49 and 2384c79.
📒 Files selected for processing (22)
src/main/ipc/skills.tssrc/main/skills/skill-update-run.test.tssrc/main/skills/skill-update-run.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsxsrc/renderer/src/components/skills/skill-freshness-group.tsxsrc/renderer/src/components/skills/skill-freshness-summary-headline.tsxsrc/renderer/src/components/skills/skill-update-result-rows.tsxsrc/renderer/src/components/skills/skill-update-run-store.tssrc/renderer/src/components/status-bar/SkillUpdateStatusSegment.test.tsxsrc/renderer/src/components/status-bar/SkillUpdateStatusSegment.tsxsrc/renderer/src/components/status-bar/StatusBar.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/web/web-preload-api.tssrc/shared/skill-freshness.ts
🚧 Files skipped from review as they are similar to previous changes (20)
- src/renderer/src/components/status-bar/StatusBar.tsx
- src/renderer/src/components/status-bar/SkillUpdateStatusSegment.tsx
- src/main/ipc/skills.ts
- src/renderer/src/assets/main.css
- src/renderer/src/components/skills/skill-update-result-rows.tsx
- src/renderer/src/i18n/locales/es.json
- src/preload/index.ts
- src/renderer/src/components/skills/skill-freshness-group.tsx
- src/renderer/src/web/web-preload-api.ts
- src/renderer/src/components/skills/skill-update-run-store.ts
- src/preload/api-types.ts
- src/main/skills/skill-update-run.test.ts
- src/renderer/src/components/skills/skill-freshness-summary-headline.tsx
- src/shared/skill-freshness.ts
- src/renderer/src/components/status-bar/SkillUpdateStatusSegment.test.tsx
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx
The ready and running views were separate components with different row shapes, so pressing Update swapped the dialog's body for a different layout. They are now the same `SkillUpdateRow` instances throughout — only the status slot's contents change — and a test asserts the row is literally the same DOM node from "update available" through pending to the result. - Collapse each skill's locations behind its own disclosure. A skill with several plugin-cache copies was dumping every path inline and burying the actions; the row now shows a location count and expands on demand. - Put status in a single slot between the name and the count rather than a leading icon column. A leading icon has nothing to show in the resting state and reserving its box just indented every name past an empty gap. - Pin the running/finished run's names in `groupSkillFreshness` so a successful update doesn't drop its own rows the instant the re-scan lands. `skill-freshness-group.tsx` becomes `skill-location-chip-copy.ts` — only its chip label/tooltip helpers survived, and it no longer holds JSX.
|
Follow-up commit
Worth flagging from QA. To re-stage an outdated skill I overwrote an installed skill's files behind the That's the "re-scan outranks the exit code" rule doing real work: a zero exit that changed nothing is not a success. The same thing would happen to a user who hand-edits an installed skill — the old terminal UI would have shown them a green check while the skill stayed stale. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/renderer/src/components/skills/skill-location-chip-copy.tsx (2)
7-80: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winReuse the shared chip-copy helpers.
Import
chipLabelandchipTooltipfromskill-location-chip-copy.tsand remove these duplicate mappings.SkillUpdateRow.tsxalready uses the exported helpers. Based on supplied graph context, this makes the shared module the single translation mapping source.
127-136: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMake location-chip tooltips keyboard reachable.
Both
TooltipTriggerinstances wrap aBadgethat renders as a non-focusablespan, so keyboard-only users cannot reach the explanatory tooltip. Use a focusable semantic trigger and provide the project-standard visible focus treatment.
src/renderer/src/components/skills/skill-location-chip-copy.tsx#L127-L136: render the chip badge through a focusable tooltip trigger.src/renderer/src/components/skills/SkillUpdateRow.tsx#L123-L132: apply the same accessible trigger structure.
🧹 Nitpick comments (1)
src/renderer/src/components/skills/SkillUpdateRow.tsx (1)
12-19: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueKeep component comments concise.
These blocks narrate layout implementation details. Reduce them to a brief rationale-only comment or remove them where the code is self-explanatory. As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.
Also applies to: 49-57
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ca1e67ad-b7d1-423d-92a3-9cd8ef9b5b5a
📒 Files selected for processing (11)
src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsxsrc/renderer/src/components/skills/SkillUpdateRow.tsxsrc/renderer/src/components/skills/skill-freshness-grouping.tssrc/renderer/src/components/skills/skill-location-chip-copy.tssrc/renderer/src/components/skills/skill-location-chip-copy.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (7)
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
Review feedback on the row header: the badge belongs immediately right of the name so it reads as part of it, and the run's status circle/check belongs to the left of the name rather than sharing the badge's slot on the far right. Name, glyph and badge are now one left-aligned group; the location count and chevron stay right-aligned. `available` still has no leading glyph — an empty reserved box only indents the name past a gap with nothing in it.
…and stopping copy Review fixes for the headless skill-update runner. Main process: - Judge per-skill outcomes on a positive signal. "Absent from eligibleUpdateNames" is not success: a deleted, half-written, or unreadable skill also leaves that list, so a corrupt update reported a green check. skillUpdateFailedNames now requires every convergent placement to come back current or newer-known. - Retire a child's handlers with a per-run token. A failed spawn emits error *and* close, so the second settle clobbered the real spawn ENOENT; a cancelled child could also settle, or write output into, the run that replaced it. The token guards the rescan's finish closure too. - Hold the run `running` until the killed process tree is actually dead. Releasing on the synchronous path let an immediate re-Update spawn a second npx writing the same bundles, with a watchdog so a sweep that never settles cannot wedge the run. - Kill the tree, not just the npx wrapper, via killWithDescendantSweep. - Publish an error instead of a silent `started: false` when the cmd.exe rail rejects the resolved npx path, which a profile directory containing & or % is enough to trigger on Windows. - Coalesce captured output into one push per tick instead of structured-cloning the whole buffer to every window on each progress frame. Renderer: - Keep rows on screen while the settling re-scan runs. Refreshing the inventory nulls it synchronously, so every row vanished at the moment the result appeared. Rows render off the last good scan; eligibility stays on the live snapshot so nothing is authorized off stale bytes. - Retry the names that failed, not the eligibility list that same re-scan has just emptied. - Add Stop, restoring the escape hatch the embedded terminal used to provide, and say "stopping" on every surface rather than claiming the update keeps running in the background. - Show a skipped skill's reason outside the disclosure, so it no longer depends on a mount-time defaultOpen a later re-scan can never re-fire. - Drop the summary line telling users to open "Update details", a control this PR removes; it was translated into four languages. - Keep the success linger from retiring a result the open dialog is showing. - Delete skill-location-chip-copy.tsx: an unreferenced copy of the old row component, colliding on basename with the module that is actually imported.
Review pass — 23 fixes pushed (
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsx (1)
77-81: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winRef mutated during render — swap for the
useState"previous render" pattern.
lastInventoryRef.current = state.inventorymutates a ref inside the render body itself (not a one-time lazy init), which React Doctor flags: a discarded/replayed render (e.g. under astartTransitionelsewhere in the app) would still leak this write even though that render never committed. React's own docs describe the safe way to do exactly this "keep last value across renders" trick: call a state setter conditionally during render, guarded by an equality check — React then discards and immediately re-renders with the new state instead of leaking a side effect from a render that gets thrown away.♻️ Proposed fix using `useState` instead of a mutated ref
- const lastInventoryRef = useRef<SkillFreshnessInventory | null>(null) - if (state.inventory) { - lastInventoryRef.current = state.inventory - } - const inventory = state.inventory ?? (state.loading ? lastInventoryRef.current : null) + const [lastInventory, setLastInventory] = useState<SkillFreshnessInventory | null>(null) + if (state.inventory && state.inventory !== lastInventory) { + setLastInventory(state.inventory) + } + const inventory = state.inventory ?? (state.loading ? lastInventory : null)And at the reset site:
if (run.state === 'idle') { - lastInventoryRef.current = null + setLastInventory(null) }Also applies to: 143-145
Source: Linters/SAST tools
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 54196193-1ae7-4ce8-82c2-483dc1b0f67b
📒 Files selected for processing (17)
src/main/ipc/skills.tssrc/main/skills/skill-update-outcome.test.tssrc/main/skills/skill-update-outcome.tssrc/main/skills/skill-update-run.test.tssrc/main/skills/skill-update-run.tssrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsxsrc/renderer/src/components/skills/SkillFreshnessUpdateDialog.tsxsrc/renderer/src/components/skills/SkillUpdateRow.tsxsrc/renderer/src/components/skills/skill-freshness-summary-headline.tsxsrc/renderer/src/components/skills/skill-update-run-store.tssrc/renderer/src/components/status-bar/SkillUpdateStatusSegment.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/skill-freshness.ts
🚧 Files skipped from review as they are similar to previous changes (11)
- src/renderer/src/components/status-bar/SkillUpdateStatusSegment.tsx
- src/shared/skill-freshness.ts
- src/renderer/src/components/skills/skill-update-run-store.ts
- src/renderer/src/components/skills/SkillUpdateRow.tsx
- src/renderer/src/i18n/locales/es.json
- src/main/ipc/skills.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/skills/skill-freshness-summary-headline.tsx
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/ko.json
…tablyai#10843) * feat(skills): run skill updates in the background without a terminal The Update skills dialog had no primary action at all — its footer was only Re-check and Close, and the real action was a pre-filled command in an embedded PTY that the user had to press Enter on. Orca already builds and validates that command, so it now runs it. - Add a headless runner for `npx --yes skills update <names> --global -y`. Both --yes flags are load-bearing: npx's skips the package-install prompt, and the skills CLI's takes its own non-interactive branch. stdin is ignored so `process.stdin.isTTY` stays falsy, which is the other half of that gate. - Own the run in main so closing the dialog backgrounds it instead of killing it, and surface it in the status bar: spinner while running, a green check on success that clears itself, and a failure that persists until acted on. - Derive per-skill outcomes by re-scanning the freshness inventory after exit rather than parsing stdout. `skills update` has no --json (that flag exists only on `list`) and reports progress per-source, not per-skill, so the run bar is deliberately indeterminate instead of faking a percentage. When the re-scan has a verdict it outranks the exit code. - Drop the version trail from the rows and surface the skill list and skip reasons directly instead of hiding them behind a disclosure. Also fixes a width bug the collapsed disclosure used to hide: deep plugin-cache paths set the dialog's width and pushed the footer actions off-screen. * refactor(skills): use one row component across every update state The ready and running views were separate components with different row shapes, so pressing Update swapped the dialog's body for a different layout. They are now the same `SkillUpdateRow` instances throughout — only the status slot's contents change — and a test asserts the row is literally the same DOM node from "update available" through pending to the result. - Collapse each skill's locations behind its own disclosure. A skill with several plugin-cache copies was dumping every path inline and burying the actions; the row now shows a location count and expands on demand. - Put status in a single slot between the name and the count rather than a leading icon column. A leading icon has nothing to show in the resting state and reserving its box just indented every name past an empty gap. - Pin the running/finished run's names in `groupSkillFreshness` so a successful update doesn't drop its own rows the instant the re-scan lands. `skill-freshness-group.tsx` becomes `skill-location-chip-copy.ts` — only its chip label/tooltip helpers survived, and it no longer holds JSX. * fix(skills): place the status glyph left of the skill name Review feedback on the row header: the badge belongs immediately right of the name so it reads as part of it, and the run's status circle/check belongs to the left of the name rather than sharing the badge's slot on the far right. Name, glyph and badge are now one left-aligned group; the location count and chevron stay right-aligned. `available` still has no leading glyph — an empty reserved box only indents the name past a gap with nothing in it. * fix(skills): correct the headless update run's verdict, cancel path, and stopping copy Review fixes for the headless skill-update runner. Main process: - Judge per-skill outcomes on a positive signal. "Absent from eligibleUpdateNames" is not success: a deleted, half-written, or unreadable skill also leaves that list, so a corrupt update reported a green check. skillUpdateFailedNames now requires every convergent placement to come back current or newer-known. - Retire a child's handlers with a per-run token. A failed spawn emits error *and* close, so the second settle clobbered the real spawn ENOENT; a cancelled child could also settle, or write output into, the run that replaced it. The token guards the rescan's finish closure too. - Hold the run `running` until the killed process tree is actually dead. Releasing on the synchronous path let an immediate re-Update spawn a second npx writing the same bundles, with a watchdog so a sweep that never settles cannot wedge the run. - Kill the tree, not just the npx wrapper, via killWithDescendantSweep. - Publish an error instead of a silent `started: false` when the cmd.exe rail rejects the resolved npx path, which a profile directory containing & or % is enough to trigger on Windows. - Coalesce captured output into one push per tick instead of structured-cloning the whole buffer to every window on each progress frame. Renderer: - Keep rows on screen while the settling re-scan runs. Refreshing the inventory nulls it synchronously, so every row vanished at the moment the result appeared. Rows render off the last good scan; eligibility stays on the live snapshot so nothing is authorized off stale bytes. - Retry the names that failed, not the eligibility list that same re-scan has just emptied. - Add Stop, restoring the escape hatch the embedded terminal used to provide, and say "stopping" on every surface rather than claiming the update keeps running in the background. - Show a skipped skill's reason outside the disclosure, so it no longer depends on a mount-time defaultOpen a later re-scan can never re-fire. - Drop the summary line telling users to open "Update details", a control this PR removes; it was translated into four languages. - Keep the success linger from retiring a result the open dialog is showing. - Delete skill-location-chip-copy.tsx: an unreferenced copy of the old row component, colliding on basename with the module that is actually imported. * fix(skills): divide update list from summary
Summary
The Update skills dialog had no primary action at all. Its footer was only
Re-checkandClose— the real action was a pre-filled command sitting in an embedded PTY that you had to click into and press Enter on. Orca already builds and validates that command, so it now just runs it.npx --yes skills update <names> --global -y.Linear
Part of STA-664 — Improve Orca agent skill update flow.
That ticket asks for a safe update path instead of "sending users to Settings -> CLI", and specifies the exact command form:
This PR ships that verbatim —
npx --yes skills update <names> --global -y, with--globalexplicit — plus the ticket's safety preconditions: the skill must already be installed, be one of Orca's managed skills, and sit in tracked global/home scope (SUPPORTED_GLOBAL_SKILL_TOPOLOGIESgates eligibility). Its fallback rule is honoured too: on failure the dialog surfaces the error and the exact command to copy rather than retrying background writes.Not closing the ticket. STA-664's headline ask is auto-update at user-intent boundaries (starting an orchestration workflow, opening a Linear-linked worktree, first computer-use attempt), plus per-runtime scoping and a failure cooldown. This PR builds the mechanism those triggers would call, but the triggers themselves aren't here — so it's
Part of, notFixes.Why it's shaped this way
I unpacked
[email protected]and readdist/cli.mjsrather than guessing at its capabilities:updatehas no--json.parseUpdateOptionsmatches only-g,-p,-y, and positional names;options.jsonis set solely inparseListOptions. Unknown flags are silently dropped, so passing--jsonwould look accepted and do nothing.updateGlobalSkillsgroups bybySourceand does onefetchRepoTreefor the whole group. Every Orca skill shares one source, so the slow network phase is a single opaque step. Per-skill progress does not exist to be shown, however you parse.inventorySkillFreshnessafter exit — anything still ineligibleUpdateNamesdidn't land. That's byte-level ground truth needing zero parsing. When the re-scan has a verdict it outranks the exit code.Both
--yesflags are load-bearing and separately tested:npx --yesskips the package-install prompt,skills … -ytakes the CLI's own non-interactive branch. stdin is'ignore'soprocess.stdin.isTTYstays falsy — the other half of that gate.Also fixed
A width bug the collapsed disclosure used to hide: deep plugin-cache paths set the dialog's width and pushed the footer actions off-screen. Caught only by running the real app.
Screenshots
The dialog
Every state is the same row component — pressing Update changes the row in place rather than swapping the dialog's body for a different layout. A test asserts the row is literally the same DOM node from
availablethroughpendingtodone.Before running. One row per skill, with the badge immediately right of the name. Locations are collapsed behind a per-skill disclosure with a count, instead of every path being dumped inline.
Expanded. Paths and their chips on demand.
Running. The row keeps its place and its right edge; the badge gives way to a pending circle left of the name. Indeterminate bar, because the CLI reports no parseable progress.
Success. Per-skill checks, sourced from the post-run re-scan rather than stdout.
Failure. Same row, red glyph, reason inline, with the exact command to copy.
Status bar (the run survives closing the dialog)
Spinner while running:
Green check on success:
Then it retires itself after 4s:
pnpm lintpnpm typecheckpnpm testpnpm buildVerified end-to-end in the real app against genuinely-outdated
orca-linearandorchestration, driven through the actual nudge → dialog → button:outdated→currenton disk;eligibleUpdateNamesemptied.running— it does not cancel.New tests: runner arg construction (both
--yesflags, sorted names), stdin-ignore, shell-syntax name rejection, single-run guard, ANSI/CR stripping, re-scan-outranks-exit-code, re-scan failure fallback, cancel, acknowledge. Dialog tests rewritten for the no-terminal UI. Status-segment lifecycle covered including the success linger and error persistence.verify:localization-coverageflags unlocalized "Ghostty" keywords interminal-advanced-platform-search.tsandterminal-pane-appearance-search.ts. Reproduces identically with this branch stashed.AI Review Report
Built and reviewed with Claude Code. Risks checked:
options.yes || !process.stdin.isTTYbefore removing the PTY, so a headless run can't block on input nobody can answer.resolveCliCommand+getSpawnArgsForWindowshandlenpx.cmdon Windows; PATH comes from the existinghydrateShellPathlogin-shell rail, which is what makes nvm/conda setups resolve.skill-freshness-summary-headline.tsxrather than adding a disable (per AGENTS.md).Known gaps: the runner targets this machine's global skill homes only — WSL/SSH hosts still fall outside it, matching the existing
freshnessInventoryscope.fetchRepoTreeneedsgetGitHubToken; without one the CLI prints "Failed to fetch tree" and no-ops, which the re-scan correctly reports as a failure but which I did not exercise live.