Repository navigation
Conversation
Before: a plugin panel could only call the host API rows marked
`panel: true`, so it had no way to ask its own worker for data: panels
cannot reach worker commands, plugin storage or the network.
After: a new host API method `commands.invoke` lets a sandboxed panel run
one of the same plugin's declared worker commands and receive the result
(request/response, polled by calling again).
- Params are strict `{ commandId, args? }`; plugin identity comes only
from the authenticated call context, and the call reuses
PluginService.invokeCommand so contributes.commands, built-in alias and
enablement checks apply unchanged.
- Results are capped at 64 KB serialized; larger results, timeouts and
command errors surface as `action_failed`.
- The row has `capability: null` (now an explicit, required-key opt-out
in the spec type): the gate still requires an enabled, consented
plugin but no new capability kind, so the consent fingerprint is
unchanged.
- New `panelOnly` spec flag, honoured by the gate with a distinct
`worker_forbidden` code, so a worker cannot call it.
- hello-orca panel gains a button that calls hello-ping.
Refs stablyai#15638
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe plugin host API adds Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change adds a consent-gated panel request/response path to a plugin’s declared worker commands, with bounded JSON results. The supplied implementation and tests cover the key access and dispatch behaviors; no actionable merge-blocking risk remains. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Panels gain access to their plugin’s worker commands, so compromised panel code could trigger operations or obtain data previously unavailable to it. Identity, consent, and command-declaration checks constrain this expansion, but its consequences depend on the commands each plugin exposes. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Open issue Full details: Docstring CoverageExplanation Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 12 files. (1 skipped: 1 unsupported.)
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.
ℹ️ No critical issues — a few non-blocking notes below.
Reviewed changes
- New
commands.invokehost API row — a sandboxed panel can now run one of its own plugin's declared worker commands; plugin identity comes only from the authenticated panel session, never from params. - Gate changes —
capabilityis nowPluginCapabilityKind | null(onlycommands.invokeisnull) and a newpanelOnlyflag returnsworker_forbiddenfor worker callers. - Invocation refactor — the worker-start + declared-command logic moved out of
PluginService.invokeCommandintoinvokePluginWorkerCommandand is now shared with the panel path. - Result cap + example panel button —
PLUGIN_COMMAND_RESULT_MAX_BYTES(64 KB) and ahello-pingbutton inhello-orca/panel.html, plus new/extended bridge, controller, conformance and reconciliation tests.
The security shape is sound: identity is session-bound, only same-plugin declared worker commands run, enablement/consent still apply, worker callers are denied (no re-entrancy), and the command's own host calls stay capability-gated and audited.
ℹ️ Nitpicks
src/shared/plugins/plugin-host-api.ts:128— thepanelfield comment still reads "Workers can call every method", which the newpanelOnlyflag (andcommands.invoke) now contradicts. Worth tightening to note thatpanelOnlyrows are panel-only.src/main/plugins/plugin-host-method-bindings.ts:182— the comment says the result "travels back through one bounded panel message", butPLUGIN_COMMAND_RESULT_MAX_BYTESequalsPANEL_MESSAGE_MAX_BYTESand only bounds the inner value; the{ value }wrapper plus the result-message envelope push it past that cap, and the outbound lane has no size check. No functional effect today (a value at the cap is delivered), but the stated bounded-message rationale is imprecise.config/reliability-gates.jsonc:19263— the assertion description still says "all 13 v0 methods succeed with the required consented capability"; the conformance test is now 14 and special-cases the null-capability row. Stale, since the validator only checks structure.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Addresses review notes on stablyai#25256: the host API row docs now say workers can call every method except panelOnly rows; the result-cap comment states that the 64 KB cap bounds the command value (wrapper and envelope add a few bytes; the outbound lane is not size-checked); the conformance gate description counts 14 methods and the null-capability row.
|
Thanks for the review. All three notes addressed in a6634f0 (comments/docs only, no behaviour change):
|
|
I’d like to build a Git graph plugin that shows progress across branches and worktrees inside Orca. This feature would let the plugin’s worker collect Git data and display it in the panel. Could a maintainer take a look at this PR when convenient? Thanks! |
|
@marioser Thank you for this, and sorry it sat so long. Panel-to-worker calls landed in #37013 (merged), which takes a slightly different shape: a panel calls |

ELI5
A plugin's panel is a small sandboxed web page, and its worker is the part that can read files and compute things. Today the page cannot ask its own worker for anything, so a plugin cannot show live data in its panel. This lets the page ask its own worker a question and get the answer back.
What Changed
Before: a panel could only call the three host API rows marked
panel: true(workspace.readContext,terminal.sendText,notifications.show). It could not reach its plugin's worker commands, plugin storage or the network, so a plugin whose data lives in the worker could not render it in its panel.After: a new host API method
commands.invokelets a panel run one of its own plugin's declared worker commands and receive the result. The panel polls it like any other action.Mechanism:
PLUGIN_HOST_API_V0with strict params{ commandId, args? }and result{ value }(JSON, capped at 64 KB serialized).PluginService.invokeCommand(logic moved intoinvokePluginWorkerCommandto stay under the max-lines ratchet), so thecontributes.commands, built-in alias and enablement checks apply unchanged, and the worker is started lazily as for palette commands.capabilityon host API rows is nowPluginCapabilityKind | null(still a required key, so omitting it is a type error). Onlycommands.invokeisnull: the gate skips the capability check for it but still returnsconsent_requiredwhen the plugin is disabled or its consent is stale. No new capability kind, so the consent fingerprint is unchanged.panelOnlyflag on rows, enforced by the gate: a worker callingcommands.invokegets a newworker_forbiddencode (avoids a worker invoking itself and waiting out the 30 s timeout).panel_forbiddenwas not reused because its message describes the opposite case.mutation: false: the host cannot know what a command does; any host calls the command makes are gated and audited on their own.action_failed.examples/plugins/hello-orca/panel.htmlgains a button that invokes its ownhello-pingcommand.Why
This is option 1 from #15638: a panel-callable action that invokes the plugin's own worker command (request/response, polled). It keeps the panel bridge request/response only — no new push channel, no new capability, no consent change — and grants the panel no authority the plugin did not already have: the command is declared in the plugin's own manifest and runs in its own worker.
Alternatives considered: reusing an existing capability (e.g.
workspace:read) would make the consent copy misleading; a newcommands:invokekind would re-prompt consent for adopting plugins; a host → panel push channel is a larger change to the bridge.Real use case: a plugin that tracks the prompt-cache lifetime of every agent session (Claude Code, Codex, OpenCode, Pi) from each agent's logs, and warns before the cache expires. With this change its panel shows a live countdown per session; without it the countdown has to live in a separate terminal.
Linked Issue
Fixes #15638
Visual Proof
Before/after screenshots of a plugin panel to be attached (before: the panel shows "not a panel-callable action"; after: live data from the worker).
Testing
Tested on macOS (arm64) with a dev build (
pnpm dev) of this branch, rebased on currentmain:commands.invokeevery 5 s and renders the worker's data; verified the call through the renderer bridge and viawindow.api.plugins.invokeCommand.hello-orcabutton (covered by the bridge/controller tests), Linux, Windows, SSH/relay.Automated:
New
src/shared/plugins/plugin-capability-gate.test.ts; extendedplugin-host-methods.test.ts,plugin-host-conformance.test.ts(13 → 14 methods),plugin-panel-controller.test.ts,plugin-service-reconciliation.test.ts. Cover same-plugin success, undeclared command, alias, disabled plugin, worker caller denied, oversized result, error/timeout →action_failed, and unchanged behaviour of existing rows.pnpm test src/shared/plugins src/main/plugins src/relay src/renderer/src/components/right-sidebar: 4836 passed, 2 failed — both insrc/relay/opencode-hook-selection.test.ts, and they fail identically on unmodifiedmainon this machine (environment-dependent, unrelated to this change).pnpm tc:node,oxlint,oxfmt,check:code-quality:changed,check:max-lines-ratchet: pass. Fullpnpm testandpnpm buildnot run locally.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Code: design and review orchestrated by Claude Opus 5.5, implementation by Claude Sonnet 5.5. The human contributor chose between the design options (capability handling) and verified the result locally in a dev build; the code itself was written and reviewed by the models above.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
PluginHostServicesand now requiresinvokePluginCommandfrom its policy (type-enforced).pluginApi1; existing rows keep a required capability.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)