Skip to content

fix(plugins): wire the plugin service on a headless serve, and turn plugins on from the CLI - #36838

Merged
nwparker merged 2 commits into
mainfrom
takeover/35184-headless-plugin-service
Nov 1, 2026
Merged

nwparker merged 2 commits into
mainfrom
takeover/35184-headless-plugin-service

Conversation

@nwparker

@nwparker nwparker commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​104 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​100
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​88 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67

ELI5

On a headless orca serve, plugins never fully started: the plugin service was wired up only when a window opened, and a headless host never opens one. There was also no way to turn plugins on without the Settings screen. Now the wiring happens at startup for every host, and orca plugin system on|off turns plugins on or off from the CLI.

Thanks to @jutaz, who reported this and wrote the fix. Their commit is carried here with authorship intact, rebased onto current main.

What Changed

  • The plugin service's runtime delegate and its "settings changed, so refresh" listener are now set up in initializeMainProcessPlugins, which runs on both desktop and headless hosts. They used to live in the IPC handler registration, which runs only when a window opens. Desktop still gets both, and the listener is registered exactly once instead of once per registerCoreHandlers call.
  • New plugins.setSystemEnabled RPC (host-admin) and orca plugin system on|off CLI command. It only flips the plugin system switch, so only plugins approved earlier run. It never approves anything.
  • The CLI help and the bundled orca-cli skill guide document the new command.

Why

Wiring the service where it starts, not where a window registers its IPC, fixes this for every windowless host. It doesn't need a separate headless path. A new CLI talking to an older host gets the existing "update Orca on that host" error. An older CLI is unaffected.

Linked Issue

Fixes #36709

Supersedes #35184

Visual Proof

N/A. This is a host startup wiring fix plus a CLI command; the UI doesn't change.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • New tests check that a host with no window binds the runtime and exactly one settings-refresh listener, and that the switch is admin-only and approves nothing. Both fail on main's source and pass here.

  • Every test file that imports a changed module (34 files, 327 tests) passes.

  • Static checks pass locally: format, lint, typecheck, ratchets and the RPC params catalog.

  • Codex review and an independent review both came back with no blocking findings.

  • During the rebase, src/main/ipc/plugins.test.ts kept main's new cases and dropped the listener test, since that listener moved out of the IPC handlers.

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

This works the same on macOS, Linux and Windows, and over SSH or other remote hosts. The new RPC is optional for older clients. Mobile isn't affected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • 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 (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7cd82b46-216a-4dfc-b7fa-8cde4da067ef
Commits

Reviewing files that changed from the base of the PR and between f9fe915 and 61e3556.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 16
  • skill-guides/orca-cli/references/plugins.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/handlers/plugin-runtime.ts
  • src/cli/plugin-handler-groups.ts
  • src/cli/root-help-text-primary.ts
  • src/cli/specs/plugin.ts
  • src/main/ipc/plugins-panel-document-lifetime.test.ts
  • src/main/ipc/plugins.ts
  • src/main/ipc/register-core-handlers/register-core-handlers.ts
  • src/main/plugins/__mocks__/plugin-uninstall-log-test-fixture.ts
  • src/main/plugins/plugin-dev-folders.ts
  • src/main/runtime/rpc/methods/plugins.test.ts
  • src/main/runtime/rpc/methods/plugins.ts
  • src/main/startup/main-process-plugins.test.ts
  • src/main/startup/main-process-plugins.ts
  • src/shared/rpc-contract/plugins-params.ts
  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: A headless serve never wires the plugin service, and plugins can't be turned on without Settings

2 participants