Skip to content

feat(plugins): workers can list and open workspaces, create and read terminals, launch agents - #37312

Merged
nwparker merged 5 commits into
mainfrom
nwparker/plugin-a5-host-actions
Nov 2, 2026
Merged

nwparker merged 5 commits into
mainfrom
nwparker/plugin-a5-host-actions

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​341 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​339
Prod 36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​678 $\color{#cf222e}{\Huge{\mathbf{−}}}$​58 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​620

ELI5

Full-access mods could react to Orca, but could not do much in it: they could not list workspaces, open a terminal or start an agent. Now a mod's worker can list and open workspaces, create and read terminals, and launch agents, through the same paths the orca CLI uses.

What Changed

New worker-only host methods (host API minor 3):

Method Capability Returns
workspace.list workspace:read host-qualified id, worktree/folder (project-group folders included), name, path, branch or null, hostId or null (at most 500, reports truncation)
workspace.open({ workspaceId }) workspace:write (new)
terminal.create({ workspaceId, title?, command? }) terminal:send { terminalId }
terminal.read({ terminalId, maxLines? }) terminal:read (new) plain-text lines, at most 2,000
agent.launch({ workspaceId, agent, prompt? }) agent:launch (new) { terminalId } at once; the prompt is delivered in the background
  • Each call rechecks the plugin is still enabled right before Orca acts, and a worker's cancel or exit aborts the call. terminal.create runs in the background without taking focus, and a cut-off terminal.read says so.
  • The new capabilities follow the existing pattern: declared in the manifest, shown at install, worker-only. Engine floor 1.4.248.
  • No reimplementation:
    • These call the same runtime methods as orca worktree list, terminal create/read and agent launch, through the in-process dispatcher the browser automation path already uses.
    • So the host that owns the workspace (local, WSL or SSH) does the work, and folder workspaces are included.
    • Headless serve gets them too.
  • Generated typings, host-API and manifest docs, schemas and skill references, plus a recipe ("Driving workspaces, terminals and agents from a worker").

Why

Full modability needs mods to act on Orca, not only observe it: for example, a mod that opens a terminal per issue, or launches a reviewer agent when a workspace is created. Routing through the existing runtime methods keeps one implementation for the CLI and mods, including SSH.

Not here: editor.open and commands.run need the renderer to act and have no runtime method yet. They come in a follow-up.

Linked Issue

N/A (maintainer).

Visual Proof

N/A: worker API only; covered by tests.

Testing

  • One test per method: projection and params, including SSH hostId and the folder kind, the line cap, agent validation and background launch. Also capability, worker-only and no-runtime refusals, and a guard test that fails if a dispatched runtime method stops existing.
  • 219 test files pass. pnpm tc, anti-slop, ast-grep, localization and freshness checks pass.

Risk

Level: Low. Additive and capability-gated; nothing changes for plugins that don't ask. Plain revert.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I stated the risk
  • N/A for visuals with reason

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Walkthrough

The Host API advances to version 1.3 and adds five worker-only methods for workspace, terminal, and agent actions. The change adds runtime RPC wiring and host bindings for these methods, including request and response validation and access checks. It also adds the workspace:write, agent:launch, and terminal:read capabilities, updates capability schemas and version metadata, and revises reference documentation, typings, bundled guides, and consent labels.

Merge Risk: Low · previous review c2d46

The new worker actions are mergeable with awareness that their runtime RPC contracts are not exercised end to end by the supplied tests.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: worker methods for listing and opening workspaces, creating and reading terminals, and launching agents.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description covers the core content well. The ELI5, What Changed (with a method/capability/returns table), Why, Testing, Risk (Low, plain revert), and Checklist are all filled in. The Linked Issue…
Full details: Description check

Explanation

The description covers the core content well. The ELI5, What Changed (with a method/capability/returns table), Why, Testing, Risk (Low, plain revert), and Checklist are all filled in. The Linked Issue section is marked N/A (maintainer), which is acceptable here because the template says maintainers should only attach pre-existing issues. Visual Proof is marked N/A with a reason (worker API only). The Review and AI Disclosure sections are not addressed. The Notes section asks to confirm no issues in security, cross-platform, SSH, mobile, backwards compatibility, and performance; the description touches SSH and backwards compatibility (additive, capability-gated) but does not explicitly cover security, cross-platform (Windows/Linux/macOS), mobile, or performance. The Testing section does not state which platforms were manually tested, and the manual-test box is unchecked. The Checklist omits the cross-platform/SSH and pnpm lint/typecheck/test/build items, though the author lists tests and checks run.

Full details: Docstring Coverage

Explanation

Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 18 files. (9 skipped: 9 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 1
src/main/plugins/plugin-runtime-rpc.test.ts: 1

1-19: Trivial · Maintainability & Code Quality · Quick win

This guard checks method names only, not the parameter or answer shapes.

The test confirms that each dispatched method name exists in ALL_RPC_METHODS. It does not check that the bindings send parameters the runtime accepts. It also does not check that the bindings parse the runtime answers. plugin-host-workspace-methods.test.ts mocks PluginRuntimeRpc, so no test sends the real parameters through RpcDispatcher. A schema mismatch fails only at run time. See the verification script on plugin-host-workspace-method-bindings.ts.


Review info
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: b2ee63af-5bae-4132-8574-448956e6f9d6
Commits

Reviewing files that changed from the base of the PR and between 54b496c and c2d46d6.

Files selected for processing: 28
  • docs/reference/plugin-catalog.md
  • docs/reference/plugin-host-api.md
  • docs/reference/plugin-manifest.md
  • docs/schemas/plugins/orca-catalog.v2.schema.json
  • docs/schemas/plugins/orca-plugin.v2.schema.json
  • resources/plugins/declarative/orca-testing.mjs
  • resources/plugins/types/orca-host.d.ts
  • skill-guides/orca-plugin-authoring/references/host-api.md
  • skill-guides/orca-plugin-authoring/references/manifest.md
  • skill-guides/orca-plugin-authoring/references/recipes.md
  • src/cli/bundled-skill-guides.ts
  • src/main/plugins/plugin-runtime-binding.ts
  • src/main/plugins/plugin-runtime-rpc.test.ts
  • src/main/plugins/plugin-runtime-rpc.ts
  • src/main/plugins/workers/plugin-host-method-bindings.ts
  • src/main/plugins/workers/plugin-host-service-bindings.ts
  • src/main/plugins/workers/plugin-host-workspace-method-bindings.ts
  • src/main/plugins/workers/plugin-host-workspace-methods.test.ts
  • src/main/startup/main-process-plugins.ts
  • src/renderer/src/components/plugins/presentation/plugin-capability-presentation.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/plugins/capabilities/plugin-capabilities.ts
  • src/shared/plugins/capabilities/plugin-capability-reach.ts
  • src/shared/plugins/installation/plugin-host-version.ts
  • src/shared/plugins/manifest/plugin-schema-field-docs.ts
  • src/shared/plugins/workers/plugin-host-api-workspace-methods.ts
  • src/shared/plugins/workers/plugin-host-api.ts
  • src/shared/plugins/workers/plugin-host-method-spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@nwparker
nwparker force-pushed the nwparker/plugin-a5-host-actions branch from c2d46d6 to 502f1c2 Compare November 2, 2026 04:23
@nwparker
nwparker force-pushed the nwparker/plugin-a5-host-actions branch from 502f1c2 to 926cef0 Compare November 2, 2026 05:32
@nwparker
nwparker enabled auto-merge (squash) November 2, 2026 05:39
@nwparker
nwparker force-pushed the nwparker/plugin-a5-host-actions branch from 926cef0 to 18905d8 Compare November 2, 2026 05:41
nwparker and others added 5 commits November 1, 2026 21:42
…nd agents

Host API minor 3 adds worker-only rows: workspace.list (workspace:read),
workspace.open (workspace:write), terminal.create (terminal:send),
terminal.read (terminal:read, at most 2,000 lines) and agent.launch
(agent:launch). Each dispatches the runtime RPC method the orca CLI calls,
in process with the CLI's identity, so it runs on the host that owns the
workspace (local, WSL or SSH) and covers folder workspaces. The new
capabilities arrive in 1.4.248; typings, docs and skill references are
generated from the table.
…target

- Each runtime effect re-checks the plugin's approval right before the
  runtime acts (a dispatcher beforeInvoke hook, after its own waits), and a
  worker's cancel or exit now aborts the call's signal through to the runtime.
- agent.launch starts the agent's CLI in a background terminal and returns
  its handle at once; a prompt is delivered afterwards through the runtime's
  own reuse-terminal path, so the host call never waits for the composer.
- workspace.list adds project-group folder workspaces and returns ids that
  name their host (identity: keys), so twins on two hosts are never ambiguous.
- terminal.create passes presentation background; terminal.read counts a
  runtime-limited read as truncated. workspace.open refuses folders as
  unavailable until a window-side open lands.
…ne limits after rebasing on the hooks

Worker-only status bar and workspace methods spread into PLUGIN_HOST_API through
one module, the in-flight host call map moves into PluginWorkerHostCalls, and
bindPluginRuntime builds the runtime RPC so main-process-plugins.ts keeps its
size; regenerated docs and typings.

Co-Authored-By: Claude <[email protected]>
@nwparker
nwparker force-pushed the nwparker/plugin-a5-host-actions branch from 18905d8 to 7fa4801 Compare November 2, 2026 05:44
@nwparker
nwparker merged commit 544577f into main Nov 2, 2026
14 checks passed
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.

1 participant