Repository navigation
Conversation
This was referenced Nov 9, 2026
Closed
nwparker
force-pushed
the
nwparker/cli-workspace-providers
branch
from
November 9, 2026 09:08
d853f63 to
8a2c11e
Compare
`orca worktree create --on <target>` picks where a workspace runs. - An existing host (local, ssh:<id>, runtime:<id>, a host name) works exactly like --host. - A provider target creates a new host for the workspace first: recipe:<id> (orca.yaml environment recipe) or plugin:<plugin>/<id> (approved plugin recipe). - `orca provider list/show/doctor` shows and checks providers, with versioned JSON (schemaVersion 1, allow-listed fields). Provider creates: - run through the same main-side provisioning the desktop uses (write-ahead record, step timeouts, cancellation) and the shared cleanup - send an idempotency key, keyed by target, so a retry returns the same workspace - report named steps (and the new host's id as soon as it's recorded) on long-poll keepalive frames, printed as text or NDJSON on stderr - fail with host_create_failed, whose data says the step, the provider's failure code and whether the new host was destroyed Exit codes for provider creates: 2 invalid input, 4 the workspace exists but a follow-up failed, 5 a host may still be running. Plain creates keep exit 1. Based on #39228 by jutaz, a port of #28439. Co-authored-by: Justas Brazauskas <[email protected]>
nwparker
force-pushed
the
nwparker/cli-workspace-providers
branch
from
November 9, 2026 10:24
8a2c11e to
0e67574
Compare
10 of 11 tasks
9 of 11 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
orca worktree create --on <target>lets you say where a new workspace runs. The target can be a host you already have (local, an SSH host, a paired Orca server), which works exactly like--host. It can also be a provider that first creates a new host for the workspace: an environment recipe from the repo'sorca.yaml(recipe:<id>) or one an approved plugin ships (plugin:<plugin>/<id>).orca provider listshows which providers you can use.Design
One selector, two kinds of target.
local,ssh:<id>,runtime:<id>, or a name fromorca host list.recipe:<id>orplugin:<pluginKey>/<id>.The host a provider creates is an ordinary
runtime:<id>host, so the existing host and workspace commands work on it. The flag is--onand not--envbecause--environmentalready means "send this command to a paired host". Without--on, nothing changes. The default never switches to a provider.Discover:
orca provider list [--repo <selector>] [--json]orca provider show <target>: the target's capabilities, sizes, inputs and availability.orca provider doctor recipe:<id>: the same check asvm recipe doctor, which stays.JSON output has
schemaVersion: 1and a fixed set of fields per provider:target,kind,name,description,repo,available,unavailableReason,checkoutMode,capabilities{suspend,resume,destroy},timeoutSeconds,sizes,inputs.Create:
--on <provider>, plus these flags:--idempotency-key--progress text|json|nonejsonwrites NDJSON with astartedevent carrying the key, thenphaseevents, includinghost-recordedwith the new host's runtime id. stdout carries only the result.--size,--input,--inputs-fileThe result adds
host: {id, origin: {target, runtimeId}, lifecycle: 'per-workspace', state, checkoutMode},idempotencyKeyandschemaVersion.Failures. A failed create returns
host_create_failedwith:data.phase: the step that failed.data.providerCode/data.providerParams: the existing recipe failure catalog code and its parameters.data.host.state:destroyed,left-running(the provider has no destroy step),destroy-failed, orunknown(contact was lost after the host was recorded).providercommands only)data.resultholds the workspace, andnextStepsholds the shell-quoted recovery, or the replay-safe--retry-launchcommand when the launch reply was lost.Plain
worktree createkeeps exit 1 for everything, as today.Where it runs. The Orca desktop app on this computer runs provider creates, because it owns the recipes and VM records. They go through the same main-side provisioning the composer uses: the write-ahead record, per-step timeouts and cancellation. Failure cleanup uses the same shared cleanup. Ctrl+C aborts the request, and a host that finished its create step is destroyed.
Refused for now:
--environmentand--pairing-code.--activate,--parent-*and--retry-launchwith a provider target.--ontogether with--repo, because the repo already names its host.Not in this draft:
--no-wait/worktree wait.host destroy, and removal from the CLI. The phone and other-client removal leak fix is fix(vm-recipes): destroy a recipe VM when a phone deletes its workspace #40205.Explainer: sample sessions
What Changed
workspace-provider-target.ts: the target grammar, the wire schema and the canonical spelling. Recipe ids reuse the orca.yaml id rule, now in a smallorca-vm-recipe-id.ts.host_create_failed, the listing types andworkspace.providers.v1.worktree.createtakestargetinstead ofrecipeId.runtimeId.workspace-providers.ts: resolve a target in its own namespace. A plugin recipe whose id matches an orca.yaml recipe is refused, because lifecycle steps resolve by id with orca.yaml first.provider.listRPC.--on,provider list/show/doctor.provideris treated as a local-only command.Based on #39228 by @jutaz, a port of #28439.
Linked Issue
Refs #17292
Visual Proof
N/A: CLI only. Sample sessions are above; they are reconstructed from the CLI tests, not captured from a real VM.
Testing
Tests:
index-worktree-create-provider.test.ts, 19 tests:destroy-failedand for lost contact after the host was recordedprovider listandprovider showworkspace-provider-target.test.ts: the grammar round-trips.workspace-providers.test.ts: namespaces, shadowing, the listing shape.recipe-workspace-create.test.ts, 18 tests: orchestration, failure data, host outcomes.Local (macOS):
pnpm tc, oxlint and oxfmt,check:code-quality:changed,verify:rpc-params-catalogandverify:bundled-skill-guidesall pass.src/cli,src/main/ephemeral-vm,src/main/ipc/ephemeral-vm*,src/main/runtime/rpcandworkspaces/creationpass, except one existing timing test (terminal-send-ordered-input) that fails locally under load.Risk
Draft. If merged as-is: Low for anyone who doesn't pass
--on. Medium for the new path, because it starts machines. The desktop recipe flow uses the extracted provisioning and cleanup with their bodies unchanged.AI Disclosure
Agent skill upstream boundary
Checklist