Defer managed skill setup prompts until Orca restart#6102
Defer managed skill setup prompts until Orca restart#6102brennanb2025 wants to merge 15 commits into
Conversation
Co-authored-by: Orca <help@stably.ai>
|
Ready to review this PR? Stage has broken it down into 15 individual chapters for you: Chapters generated by Stage for commit 62b28a2 on Jul 2, 2026 5:37am UTC. |
|
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:
📝 WalkthroughWalkthroughThis PR implements an end-to-end "Agent Skill Auto-Update" system for Orca-managed agent skills. It introduces shared managed-skill types and a non-interactive 🚥 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: 7
🧹 Nitpick comments (2)
src/renderer/src/web/web-preload-api.ts (1)
2290-2324: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a short why-comment for the web-only fallback.
This intentionally never installs/updates skills from the web preload. Add a one-line rationale so future changes do not treat the fallback as missing implementation. As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”
♻️ Proposed refactor
ensureManagedReady: (request: ManagedAgentSkillEnsureRequest) => { + // Why: web preload cannot perform trusted host updates, so managed skills are remote-only fallbacks. const uiKey = ['remote', '', request.skillName, request.context].join(':')Source: Coding guidelines
src/main/skills/managed-skill-discovery-candidate.ts (1)
8-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider documenting the dual-check rationale.
The function checks both
skill.nameandbasename(skill.directoryPath). While this defensive approach makes sense (skills might be identified by either their metadata name or folder name), a brief comment explaining when each case applies would improve maintainability.📝 Example comment
export function isDiscoveredManagedSkill( skill: DiscoveredSkill, skillName: ManagedAgentSkillName ): boolean { + // Check both metadata name and directory basename because skills can be + // identified by either (e.g., when skill.json is missing or skill.name differs from folder). const expected = normalizeSkillName(skillName)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 65f49013-e491-401d-bffb-71684ca210cf
📒 Files selected for processing (62)
docs/reference/agent-skill-auto-update-plan.mdsrc/main/index.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/ipc/runtime-environments.test.tssrc/main/ipc/runtime-environments.tssrc/main/ipc/runtime-managed-skill-nudge.tssrc/main/ipc/runtime.tssrc/main/ipc/skills.test.tssrc/main/ipc/skills.tssrc/main/runtime/rpc/dispatcher-feature-interactions.test.tssrc/main/runtime/rpc/dispatcher.tssrc/main/runtime/rpc/managed-skill-nudge.tssrc/main/runtime/rpc/runtime-feature-interaction-id.tssrc/main/runtime/runtime-rpc.tssrc/main/skills/discovery.tssrc/main/skills/managed-skill-discovery-candidate.tssrc/main/skills/managed-skill-discovery-selection.tssrc/main/skills/managed-skill-ensure-result.tssrc/main/skills/managed-skill-fallback-message.tssrc/main/skills/managed-skill-global-candidate.tssrc/main/skills/managed-skill-lockfile.tssrc/main/skills/managed-skill-target.tssrc/main/skills/managed-skill-update-cache-key.tssrc/main/skills/managed-skill-update-contract.tssrc/main/skills/managed-skill-updates.test.tssrc/main/skills/managed-skill-updates.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/App.tsxsrc/renderer/src/components/onboarding/onboarding-feature-setup.test.tssrc/renderer/src/components/settings/AgentSkillSetupPanel.test.tsxsrc/renderer/src/components/settings/AgentsPane.test.tsxsrc/renderer/src/components/settings/AgentsPane.tsxsrc/renderer/src/components/settings/BrowserUseSkillStep.test.tsxsrc/renderer/src/components/settings/CliSection.test.tsxsrc/renderer/src/components/settings/OrchestrationPane.test.tsxsrc/renderer/src/components/settings/agent-skill-installed-command-callers.test.tssrc/renderer/src/components/settings/agents-search.tssrc/renderer/src/components/settings/managed-agent-skill-background-updates-copy.tssrc/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsxsrc/renderer/src/components/skills/ManagedAgentSkillSetupDialogHost.test.tssrc/renderer/src/components/skills/ManagedAgentSkillSetupDialogHost.tsxsrc/renderer/src/components/skills/managed-agent-skill-dialog-copy.tssrc/renderer/src/components/skills/managed-agent-skill-dialog-state.tssrc/renderer/src/hooks/installed-agent-skill-discovery.tssrc/renderer/src/hooks/useInstalledAgentSkills.test.tssrc/renderer/src/hooks/useInstalledAgentSkills.tssrc/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/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.test.tssrc/renderer/src/web/web-preload-api.tssrc/shared/agent-feature-install-commands.test.tssrc/shared/agent-feature-install-commands.tssrc/shared/constants.tssrc/shared/skills.tssrc/shared/types.ts
…date-detection # Conflicts: # src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts # src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsx # src/renderer/src/hooks/useInstalledAgentSkills.test.ts # src/renderer/src/hooks/useInstalledAgentSkills.ts # src/renderer/src/store/slices/worktrees.test.ts # src/renderer/src/store/slices/worktrees.ts # src/shared/agent-feature-install-commands.test.ts
Co-authored-by: Orca <help@stably.ai>
…date-detection # Conflicts: # src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts
This reverts commit 204b3e0.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (1)
src/main/skills/managed-skill-update-cache-key.ts (1)
17-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument why the success cache key ignores request context/target.
This key intentionally collapses multiple workspaces onto the same verified global lock hash, but that reads like an accidental cache-collision bug without a short rationale comment.
As per coding guidelines, "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 050a703f-e776-44cb-b985-b4c262471508
📒 Files selected for processing (45)
docs/reference/agent-skill-auto-update-plan.mdsrc/main/index.tssrc/main/ipc/runtime-environments.test.tssrc/main/ipc/runtime-managed-skill-nudge.tssrc/main/ipc/skills.test.tssrc/main/ipc/skills.tssrc/main/runtime/rpc/dispatcher-feature-interactions.test.tssrc/main/runtime/rpc/managed-skill-nudge.tssrc/main/runtime/rpc/methods/skills.test.tssrc/main/runtime/rpc/methods/skills.tssrc/main/runtime/rpc/runtime-feature-interaction-id.tssrc/main/skills/managed-skill-ensure-result.tssrc/main/skills/managed-skill-events.tssrc/main/skills/managed-skill-fallback-message.tssrc/main/skills/managed-skill-global-candidate.tssrc/main/skills/managed-skill-post-update-verification.tssrc/main/skills/managed-skill-test-fixtures.tssrc/main/skills/managed-skill-update-cache-key.tssrc/main/skills/managed-skill-update-contract.tssrc/main/skills/managed-skill-update-coordinator-registry.tssrc/main/skills/managed-skill-update-runner.test.tssrc/main/skills/managed-skill-update-runner.tssrc/main/skills/managed-skill-updates-safety.test.tssrc/main/skills/managed-skill-updates.test.tssrc/main/skills/managed-skill-updates.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/App.tsxsrc/renderer/src/components/emulator-pane/use-emulator-pane-controls.tssrc/renderer/src/components/emulator-pane/use-emulator-pane-session.tssrc/renderer/src/components/emulator-pane/use-emulator-pane-shutdown.tssrc/renderer/src/components/settings/AgentSkillSetupPanel.test.tsxsrc/renderer/src/components/settings/AgentSkillSetupPanel.tsxsrc/renderer/src/components/settings/MobileEmulatorSettingsPane.tsxsrc/renderer/src/components/skills/ManagedAgentSkillSetupDialogHost.test.tssrc/renderer/src/components/skills/ManagedAgentSkillSetupDialogHost.tsxsrc/renderer/src/components/skills/managed-agent-skill-dialog-copy.tssrc/renderer/src/components/task-page-github-work-item-status.tssrc/renderer/src/hooks/installed-agent-skill-discovery.tssrc/renderer/src/hooks/useInstalledAgentSkills.test.tssrc/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 with no reviewable changes (12)
- src/renderer/src/components/settings/MobileEmulatorSettingsPane.tsx
- src/renderer/src/hooks/useInstalledAgentSkills.test.ts
- src/renderer/src/components/skills/managed-agent-skill-dialog-copy.ts
- src/renderer/src/components/skills/ManagedAgentSkillSetupDialogHost.test.ts
- src/renderer/src/hooks/installed-agent-skill-discovery.ts
- src/renderer/src/components/task-page-github-work-item-status.ts
- src/renderer/src/components/skills/ManagedAgentSkillSetupDialogHost.tsx
- src/renderer/src/i18n/locales/ko.json
- 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/ja.json
✅ Files skipped from review due to trivial changes (1)
- docs/reference/agent-skill-auto-update-plan.md
🚧 Files skipped from review as they are similar to previous changes (11)
- src/main/ipc/runtime-managed-skill-nudge.ts
- src/main/runtime/rpc/managed-skill-nudge.ts
- src/renderer/src/components/settings/AgentSkillSetupPanel.test.tsx
- src/main/runtime/rpc/runtime-feature-interaction-id.ts
- src/main/skills/managed-skill-fallback-message.ts
- src/renderer/src/App.tsx
- src/preload/api-types.ts
- src/preload/index.ts
- src/main/skills/managed-skill-global-candidate.ts
- src/main/ipc/skills.ts
- src/main/index.ts
…date-detection # Conflicts: # src/main/index.ts # src/main/ipc/register-core-handlers.test.ts # src/main/ipc/register-core-handlers.ts # src/main/ipc/runtime-environments.ts # src/main/runtime/rpc/methods/skills.ts # src/renderer/src/components/emulator-pane/use-emulator-pane-session.ts # src/renderer/src/components/settings/ExperimentalPane.test.tsx # src/renderer/src/components/settings/OrchestrationPane.test.tsx # src/renderer/src/components/settings/experimental-search.ts # src/renderer/src/store/slices/worktrees.test.ts # src/renderer/src/store/slices/worktrees.ts # src/shared/agent-feature-install-commands.test.ts
The update->add conversion for native Windows (skills update is unreliable there, PR #6307) silently stopped matching when update commands gained the non-interactive npx --yes ... --yes shape, and the new managed-skill flow bypassed it entirely: - Widen the renderer normalizer regex to match both command shapes, so all settings panels convert again on win32 - Build update-kind manual commands host-platform-aware in the main process (the modal command executes on the host, and web clients can't know the host platform from the browser) - Make the background auto-update runner reinstall from the repo source on win32 instead of spawning the unreliable skills update - Pin the normalizer tests to the real shared command constants so a future shape change can't silently strand the regex again Co-authored-by: Orca <help@stably.ai>
TL;DR
This PR records managed-skill needs when Orca workflows use
orca-linear,orchestration,computer-use, ororca-cli, then asks after the next Orca restart if setup still needs attention. Workflow entry no longer opens the install/update modal immediately.On startup, Orca flushes the recorded requests through the managed-skill coordinator. If the skill is already ready, the request is cleared and nothing is shown. If the skill still needs setup and prompts are enabled, Orca shows the contextual install/update modal. If the experimental background update setting is enabled and the install is a verified safe global Orca-managed install, Orca can update during that restart-time flush instead of showing the modal.
The automatic path remains intentionally narrow and off by default: tracked global Orca-managed installs only, after the user explicitly enables the experimental setting. Orca does not auto-install missing skills, does not run broad
skills update, and does not mutate project, remote/WSL, ambiguous, symlinked, bundled/plugin, or untracked/custom installs.When Orca Updates vs Prompts
orca-linearorchestrationcomputer-useorca-cliskills:flushRestartPromptsonce after settings hydrate, as long asShow agent skill setup promptswas enabled at startup.readyorupdated, Orca clears that persisted request and shows nothing.npx --yes skills update <skill> --global --yesand shows the modal.npx --yes skills update <skill> --global --yesfrom the home directory, withshell: false, a 120s timeout, abort support, and post-update verification. Success emits anupdatedevent and clears the pending request; no modal is shown. If update fails, times out, or post-update verification fails, Orca falls back to the manual update modal.cooldown,target-required, andunsupported-skillare intentionally not emitted as modal events.Not nowsnoozes the currentuiKeyfor the session;Don't show againdisables the prompt setting and leaves workflows unblocked.What Changed
deferManagedReadyPrompt,skillslock metadata,npx --yes skills update <skill> --global --yesfrom a neutral cwd,updated.Show agent skill setup prompts, which controls whether restart-time managed-skill install/update prompts appear.Don’t show againin the modal to disable that prompt setting, show a toast explaining where to re-enable it, and offer anOpen Settingsaction back to Settings > Agents. If the settings write does not stick, Orca keeps the modal open and shows a failure toast instead of claiming prompts are off.skills.managedEvents, including retry coverage for re-pair, stream close/error/end, and transient pending subscribe failures.Modal Copy
With workspace:
A worktree was started from a Linear task in <workspace>. <Install/Update> the Linear agent skill to enable agents to read and update Linear issues.Orca Orchestration was used in <workspace>. <Install/Update> the orchestration skill to enable agents to coordinate reliably.Computer Use was used in <workspace>. <Install/Update> the Computer Use skill to enable agents to control apps reliably.The Orca CLI skill is needed in <workspace>. <Install/Update> the CLI skill to enable this workflow to continue reliably.Without workspace:
A worktree was started from a Linear task. <Install/Update> the Linear agent skill to enable agents to read and update Linear issues.Orca Orchestration was used. <Install/Update> the orchestration skill to enable agents to coordinate reliably.Computer Use was used. <Install/Update> the Computer Use skill to enable agents to control apps reliably.The Orca CLI skill is needed. <Install/Update> the CLI skill to enable this workflow to continue reliably.Safety Model
Auto-update is allowed only during restart-time flush, only when the experimental setting is explicitly enabled, and only when Orca can prove it is updating the same tracked global install the user already has. It requires a supported managed skill name, host runtime, a single non-symlinked global install, managed lock metadata, no recent failure cooldown, and successful post-update verification.
Unsafe cases fall back instead of mutating: missing installs, project installs, ambiguous installs, bundled/plugin installs, symlinked globals, malformed/missing/unmanaged lockfile entries, remote/WSL/repair-required runtimes, unsupported skills, update failures, and update timeouts.
Design / Review / Perf
Validation
Latest local validation for the restart-deferred prompt change:
src/main/ipc/skills.test.ts,src/main/ipc/runtime-environments.test.ts,src/main/persistence.test.ts,src/renderer/src/components/skills/ManagedAgentSkillSetupDialogHost.test.ts,src/renderer/src/store/slices/worktrees.test.ts(5 files, 569 tests passed)src/renderer/src/web/web-preload-api.test.ts(1 file, 59 tests passed)pnpm run typecheck:nodepnpm run typecheck:cligit diff --checkLatest manual Electron validation with
$brennan-test-changes:window.api.app.getIdentity()returneddevBranch: brennanb2025/skill-update-detectionanddevRepoRoot: /Users/thebr/orca/workspaces/orca/skill-update-detection.HOMEandORCA_DEV_USER_DATA_PATH, withdemo-projectas the workflow context; no real Orca repo, issue, PR, or user skill install was modified.orchestrationrestart prompt request and captured a full-page screenshot showing no modal before restart:/tmp/orca-managed-skill-private-before.png(1512x886).demo-project:/tmp/orca-managed-skill-private-update-modal.png(1512x887).Updatecontrol and captured a full-page screenshot showing the embedded terminal withnpx --yes skills update orchestration --global --yeswaiting for Enter:/tmp/orca-managed-skill-private-terminal.png(1512x887).Validation attempted but blocked by existing toolchain/environment issues:
pnpm run typecheck:webis blocked by unrelated missing Testing Library module/type errors inMobileNetworkInterfaceSection.test.tsxandTerminalSshReconnectOverlay.test.tsx.oxlintis blocked by the mergedmobile/.oxlintrc.jsonunsupported unicorn rule:no-array-fill-with-reference-type.Earlier local validation after resolving and pushing the merge with
origin/main:src/renderer/src/components/settings/ExperimentalPane.test.tsx,src/renderer/src/components/settings/OrchestrationPane.test.tsx,src/renderer/src/store/slices/worktrees.test.ts,src/renderer/src/components/emulator-pane/use-emulator-pane-session.test.ts(4 files, 210 tests passed)src/main/ipc/register-core-handlers.test.ts,src/main/ipc/runtime-environments.test.ts,src/shared/agent-feature-install-commands.test.ts(3 files, 37 tests passed)git diff --checkAdditional review validation already captured before this latest change:
f6568ccf4: PR checks passed at that time (verify, native smoke on Ubuntu, native smoke on Windows; platform matrix entries skipped as expected).Residual Risk
managedAgentSkillBackgroundUpdatesEnabled: trueremain opted in; production users have not received that default-on build.