config/cloud-build-defaults.json feeds an ORCA_CLOUD_BUILD_DEFAULTS define in main; packaged
builds read no shell env. ORCA_BUILD_BILLING_API_URL / ORCA_BUILD_CLOUD_SANDBOX_URL override at
build time, ORCA_BILLING_API_URL / ORCA_CLOUD_SANDBOX_URL at run time. Public endpoints only.
Request the project on the shared issue node fields and map it in
mapRawIssueForWorkspace, so list/search rows carry the project the same
way issue detail already did. Detail now reuses the shared mapping.
Co-authored-by: Neil <neil@stably.ai>
The Codex config line scanner only treated exactly three quotes as the
multiline closer, so a value like '''printf 'ok'''' left the scanner
inside the string and later tables (e.g. [projects."..."]) were missed
when writing project trust. Match toml_parser: a run of 3-5 quotes
closes the string, with up to two quotes belonging to the content.
Co-authored-by: Neil <neil@stably.ai>
* fix(terminal): don't restart every dead saved tab when a worktree opens; log how the daemon exited
Opening a worktree mounted every saved terminal tab that had no PTY, and each
hidden mount started a fresh shell or agent. With many finished agent tabs this
started dozens of agents at once and could exhaust a host's process limit.
Saved tabs with no PTY anywhere and nothing queued to start now wait until
they are shown; the existing capped idle warm-up still admits up to four.
The main process now records the daemon's exit code or signal and names it in
the respawn log line.
Fixes#39166
* fix(daemon): forget a predecessor's exit when a replacement daemon launches
The plain-shell readiness test polled with vi.waitFor (1s default budget)
for reconcileConfig and the spawn env. Under CPU load the spawn takes over
a second and the test failed with 'expected undefined to be defined'.
Await an explicit reconcile-started signal and the spawn itself, and move
cleanup to onTestFinished so the gate is released and spies/env restored
even when a regressed spawn blocks until the test timeout.
Fixes#40078
Co-authored-by: Jerry Wu <haoyuwu@andrew.cmu.edu>
* feat(sidebar): replace footer Settings and Help icons with an account menu
* fix: keep account menu header on primitive spacing; move focus-read allowance
* fix(sidebar): address account menu review findings
* feat(billing): Cloudflare Worker for Stripe checkout, portal, webhooks, entitlements and usage (#7)
Test-mode-only foundation for paid Orca plans: hosted Checkout/Portal,
signed + idempotent Stripe webhooks that re-read subscriptions, a D1 ledger
for sandbox usage with overage-only Billing meter events, and entitlement
checks for the desktop and the sandbox control plane.
* feat(billing): Plan & billing in the Orca account settings and account menu (#9)
Shows the signed-in account's plan, sandbox hours used and left, and opens
hosted Stripe Checkout (Upgrade) or the Customer Portal (Manage billing) in
the browser. Main mints a short-lived billing token from Orca Cloud auth and
only opens checkout.stripe.com / billing.stripe.com URLs. Hidden until
ORCA_BILLING_API_URL is set; the account menu item is gated on the 'billing'
cloud capability and registers through a local adapter that mirrors the
upcoming account menu API.
* feat(billing): plans and prices from config, opt-in Stripe Tax, real account menu
- Worker: BILLING_PLANS JSON overrides the plan catalog (labels, display price,
hours, limits); entitlements return the plan list so the desktop shows no
hardcoded prices. STRIPE_AUTOMATIC_TAX=true adds automatic_tax and tax id
collection to Checkout (default off). Setup script takes prices from env.
- Desktop: register Plan & billing through the sidebar account menu
(merged nwparker/sidebar-account-menu) and drop the local adapter.
- Register the billing Worker's tests with the test-runner check.
* feat(billing): Team pricing, opt-in overage, Stripe test-mode e2e, dev deploy (#18)
* feat(billing): Team-only pricing, opt-in overage with spend cap, live Stripe test-mode e2e
- Catalog: Team $50/seat/mo or $480/seat/yr, 60 Standard h/seat/month pooled
(monthly windows on annual plans), Large 2x, 3 running/seat, 15-min idle sleep;
Enterprise is contact-only. All numbers/labels in BILLING_PLANS defaults.
- Overage is opt-in (adds the metered item), $0.75/h, monthly spend cap (default
$25, admin-raisable) enforced in the meter outbox; 80%/100% usage warnings.
- Checkout: plan/interval/seats with adjustable quantity; portal configuration var.
- Workers reject fetch redirect 'error': use 'manual'. Log route errors.
- scripts/stripe-test-setup.ts creates the test catalog + portal configuration;
scripts/e2e-test-mode.ts drives Checkout (headless, test card), overage, meter,
cap, annual, test-clock renewal, payment failure and cancel.
- Desktop: Team/Enterprise cards with interval + seats, usage warnings, overage
toggle + cap; split into copy/offers/usage modules.
* feat(billing): dev deployment config, dev operator keys, return page
- wrangler.dev.jsonc for orca-billing-dev (workers.dev, dev D1, test-mode prices).
- BILLING_DEV_JWKS (issuer orca-billing-dev-test) accepted only when BILLING_ENV
is not prod, for e2e runs until auth mints billing tokens.
- GET /return: static 'return to Orca' page for Checkout/Portal redirects.
- Design doc: final pricing, dev URL and resources for the control plane.
* feat(billing): team seats follow membership, payment grace + suspend signal, Team UI
Worker
- Seats = org members from Orca Cloud auth (single source of truth; pending invites
never count; min 1): auth pushes POST /v1/internal/seats, billing pulls
/v1/internal/billing/org-members at Checkout and in a reconcile cron, fails closed
(503) if auth is configured but unreachable. No token claim carries a count.
- Proration: adds always_invoice, removals create_prorations (Stripe default).
- Billing admin actions require a token minted in the last 6 minutes.
- Payment failure: past_due_since (migration 0003); new starts stop at once;
after 96 h (paymentGraceHours) reason payment_grace_expired + suspendRunning on
check/usage, and GET /v1/internal/suspensions for the control plane.
- Portal config: monthly<->annual + cancel only (seats follow membership).
- e2e: seat add/remove proration, grace expiry -> suspend -> pay -> resume.
Desktop
- Team section + account menu item: members/roles, invite, change role, remove
with confirm, revoke invites (owners/admins, auth role rules mirrored).
- Payment issue banner with suspension date and Update payment method.
* feat(billing): in-app plans page (#22)
A pricing/plans page reachable from the account menu ("Plan & billing"), the
Settings plan section ("Choose a plan" / "Compare plans"), and any upsell via
openPlansPage(). Everything comes from the billing service's offers: Team
monthly/annual (with the computed annual saving), pooled hours, Large weight,
concurrency, idle sleep, opt-in overage with spend cap, and Enterprise contact.
- States: choose (admin), locked (member), current plan with usage, payment
failure (status-first), checkout in progress, loading and failure with retry.
- Seats are read-only: one per team member (billing re-reads the count).
- Shared card shell keeps both cards' footers level; sliding interval toggle and
price fade respect reduced motion; dialog opens without a pre-focused button.
- Worker offers gain per-seat cents and the Large weight for totals.
- Copy matches the marketing /cloud promises: agents keep running, wake in
seconds, secrets never stored in the VM.
* wip(cloud): Orca Cloud built-in provider wiring
* feat(cloud): no-plan upsell opens the plans page
* feat(cloud): Orca Cloud dogfood fixes (provider persistence, picker label, any-input activity, idle override)
* fix(cloud): live dogfood fixes (snapshot already-deleted, agent egress wildcards, golden image id) + results
* fix(cloud): i18n keys, typed dev JWK, verdict typing
* feat(cloud): billing caps from billing (maxConcurrentSandboxes, per-member), userId on usage; concurrency copy
* feat(cloud): golden image can pin a released orca-server tarball (--release), source build stays the fallback
* fix(cloud): async dev key read, runtime localization catalog
- Seats billed = the period's peak membership: adds above paid seats are charged now
(always_invoice); removals never credit mid-period and only lower the quantity inside
seatTrueDownHours of renewal (proration none), so remove/re-add churn can't dodge or
double-charge. The cron applies deferred decreases from the last pushed count.
- Included hours and caps come from billed seats; per-member concurrency cap
(member_concurrency_limit); usage attributed to the member who started it.
- Start check returns billed `seats` and the derived caps for the control plane.
- Desktop shows when paid seats drop at renewal; proration copy updated.
- Design doc: seat-fairness decision with the GitHub/Cursor/Slack/Linear comparison.
Sign out of Claude/Codex on a host now runs that agent's logout against the
login launches there use, after a confirm dialog, instead of deleting the
host's saved Orca account. The host check asks the CLI in that same login.
Starting Claude or Codex on a runtime host where it isn't signed in holds the
launch behind an inline card. Sign in with browser runs the unmodified CLI login
on the host; this computer forwards the browser's localhost callback to it over
a narrowly scoped tunnel, so the token never leaves the host. Adds a verdict-only
host check, agent sign-out in the host menu, and paste/device-code fallbacks.
* fix(terminal): end a dead preserved terminal host's PTYs as host loss
After an update Orca keeps the previous version's terminal host so agents
survive. That host has no respawn, so when it later died nothing ended its
PTYs: panes stayed connected on a frozen frame and input went nowhere.
Once every reconnect attempt finds its endpoint refused or missing, each of
its PTYs now ends as host loss with history kept, and the pane's restore is
no longer refused because the dead host cannot answer.
Fixes#38432
* fix(terminal): require process-exit proof on POSIX and keep checking until proven
Review follow-ups: an unproven attempt restarts the count instead of ending
the check; on POSIX the old host's pid must also be gone; a proven-gone host
answers 'not live' for every id; one throwing exit listener cannot strand
the remaining sessions.
* fix(dictation): wait as long as the host's cloud deadline when a paired phone or browser stops
* fix(dictation): compute the host's cloud deadline from its exact sample count
* fix(dictation): store Auto as Toggle plus hold-to-record so older builds keep a working shortcut
* test(mobile): type the Auto mode settings fake instead of casting
* fix(dictation): migrate a stored Hold without hold-to-record
* fix(dictation): keep phone mode segments typed and clear hold-to-record when a phone picks Hold
* refactor(dictation): reuse the shared mode settings in the migration and phone writes
* fix(native-chat): continue every usage-limited chat at once and stop after five automatic refails
The automatic continue sent one chat per 10 s sweep, so chats stopped by the same limit resumed one by one. Its retry budget belonged to the cut, so a continuation that hit the limit again started a fresh budget and could repeat indefinitely.
Send every due chat in one pass, one at a time. Count consecutive automatic continues that ended in another usage limit from the journal: each continue's message id names the cut it answered, and the next cut's turn is joined to that submission through its key or provider item. After five, the chat shows that Orca won't continue it automatically.
* fix(native-chat): read the usage-limit continue chain from the tail, not the whole conversation
The chain walk built a map over every journal row and rescanned history for each link. Walk back from the end instead, so the work is the chain's own rows; add an N/10N contract. Replace the fan-out test's casts with typed fixtures.
* test(native-chat): count a Claude echo-opened continue in the usage-limit chain
* fix(native-chat): derive the usage-limit continue chain once per cut
A status rebuild for the same cut reuses the chain it already derived, since only history before the cut decides it; the turn's limit is read without copying its rows.
* fix(native-chat): skip slash-command turns when walking a usage-limit continue chain
A /compact run after a usage limit sits between the cut and its automatic continue; the latest-turn read skips it, so the chain walk must too. Count visited rows in the perf contracts with typed getters.
* test(native-chat): type-guard the recorded Claude capture events
* fix(native-chat): recompute the usage-limit chain when a late receipt attributes its opener
Reuse across rebuilds is keyed on the cut, its turn row's revision and the newest send, so a late attribution that completes a join is counted instead of keeping a stale zero.
* test(native-chat): guard usage-limit chain reuse at the status projection
Drives StructuredAgentSessionJournalProjections.read through real journal invalidations at 100 and 1000 turn rows: one chain derivation for an unchanged cut, again for a new cut or epoch, and a recount when a late receipt attributes the continue's opener.
* fix(native-chat): reuse a usage-limit chain only while everything it read is unchanged
The chain walk now reports the turn rows it looked up and the oldest submission it examined; the status projection keys reuse on their revisions and join evidence, so a late receipt for any link, not just the newest send, recounts the chain.
* fix(native-chat): derive the usage-limit chain fresh on each status rebuild
Reuse across rebuilds kept missing inputs the walk reads (late receipts, revised failure rows) and its key re-serialized settled history. The status projection's own cache still skips unchanged reads; each rebuild now walks only the chain's tail. Contract tests at the projection count total reads: independent of earlier history, linear in the chain's rows, one scan of the sends when no opener matches.
* fix(native-chat): find an echo-opened turn's opener without reading the turn before it
A Claude echo-opened turn names the provider's key while its opener row keeps the submission's, so the slash-command check scanned the whole previous turn and missed echo-opened commands. It now stops at the nearest root user row.
* fix(dictation): stop a phone's cloud dictation at the 10-minute limit with a notice
* test(dictation): pin the cap flag on every phone chunk reply
* perf(dictation): skip decoding phone audio the host will drop past the cloud cap
Deleting a recipe workspace from the phone removed only its checkout and
left the VM this desktop created for it running. Only the desktop window
ran the destroy.
The relaying desktop now tags the rows of workspaces whose VMs it created
with the environment's name, and says whether deleting will destroy it.
The phone's delete sheet names the environment, and its delete asks for
the destroy (`destroyHost: true`). The desktop then owns that removal:
- it runs as a workspace lifecycle delete
- the environment's Orca removes the checkout and must answer positively.
An older Orca that answers on acceptance is polled until the workspace
is gone.
- the VM is destroyed through the shared cleanup, behind any running wake
or suspend, and only when no other workspace remains on it
- the result reports host.state truthfully: destroyed, kept, or
left-running (no destroy step)
The environment's own error codes reach the phone unchanged, and a failed
removal shows its message on the phone instead of only a haptic.
Removals that don't ask for the destroy (older phones, the CLI, other
clients) keep today's behavior. No CLI API changes.
Based on #39235 by jutaz, a port of #28435.
Co-authored-by: Justas Brazauskas <brazauskasjustas@gmail.com>
After a recipe provisions a VM, run the environment doctor on the VM's own
server (new environment.doctor RPC) before creating the workspace. The VM
create sheet shows Provision VM, Check environment and Create workspace; a
failed step gets Fix with agent, Retry, Edit recipe, and (for checks) Open
anyway, which keeps the VM. Older VM servers skip the checks; dismissing
aborts a running check and destroys the VM as before.
* feat(dictation): dictate into the focused field of a page in the browser pane
* test(dictation): cover dictation into a focused browser page
* fix(dictation): type page dictation through the frame that owns the field
* fix(dictation): space page rich-text dictation within its block and offer editors the beforeinput
* test(dictation): simplify the page insertion test mock
* fix(dictation): copy page dictation to the clipboard when an editor blocks the input
* feat(plugins): add workspace.rename and project names in workspace.list
Plugins that name workspaces had to read Orca's private runtime token and call
worktree.set over the runtime socket, bypassing capability consent. workspace.rename
(workspace:write, worker only, host API 1.5) does the same update as a sidebar
rename. workspace.list rows gain the project name so plugins can prefix names
without reading the runtime's repo list.
* fix(plugins): harden workspace.rename against twin folders and hidden characters
Folder renames require a unique folder id, so twins on two hosts are not both renamed,
and fail when no folder has the id. Names refuse C1, bidi and zero-width characters,
which could make a label read as another workspace's name.
* fix(plugins): workspace.rename matches a sidebar rename for folders and reports kept names
A folder rename also cancels a pending first-agent-message rename, so the automatic
title cannot replace the plugin's name. A rename Orca does not apply (during a WSL
move) is a conflict instead of a silent success. workspace.list's project is optional,
so mocks written for host API 1.4 still validate. More invisible characters are refused.
* refactor: move atomic publication to its filesystem owner
* refactor: group shared browser definitions by feature
* refactor: bind proxy process and session contracts to defining owners
* refactor: consolidate direct session contract type imports
* refactor: retain atomic publication test timing under moved owner
* fix(benchmark): resolve historical tunnel framing source before loading
A pricing/plans page reachable from the account menu ("Plan & billing"), the
Settings plan section ("Choose a plan" / "Compare plans"), and any upsell via
openPlansPage(). Everything comes from the billing service's offers: Team
monthly/annual (with the computed annual saving), pooled hours, Large weight,
concurrency, idle sleep, opt-in overage with spend cap, and Enterprise contact.
- States: choose (admin), locked (member), current plan with usage, payment
failure (status-first), checkout in progress, loading and failure with retry.
- Seats are read-only: one per team member (billing re-reads the count).
- Shared card shell keeps both cards' footers level; sliding interval toggle and
price fade respect reduced motion; dialog opens without a pre-focused button.
- Worker offers gain per-seat cents and the Large weight for totals.
- Copy matches the marketing /cloud promises: agents keep running, wake in
seconds, secrets never stored in the VM.
* fix(speech): send cloud dictation through the proxy set in Settings
* fix(speech): keep OpenAI cookies out of the desktop session
* refactor(speech): send transcription and the key check through one request helper
* fix(worktrees): offer nested-worktree delete for remote runtime hosts
A remote host's 'contains another registered worktree' refusal showed only
the raw error. Add worktree.previewNestedRemoval and an approved-plan
worktree.rm path on the runtime, and route the toast's nested-delete dialog
to the workspace's own host.
* fix(worktrees): re-check checkouts between remote nested deletes; scale reply timeout
* chore: compose nested worktree ids; record improved ratchets
---------
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
* fix(orchestration): keep a paired server's worker list when one Dispatch is from an earlier pairing
The server's fleet snapshot refused the whole batch when one requested
Dispatch was not this home's (for example, one started before the home
re-paired), so the home showed every worker on that server as
host_unavailable. Now only that Dispatch reads as unverifiable.
* test(orchestration): cover a live Dispatch held for another home in the fleet snapshot
* test(orchestration): assert the other home's fleet item without a cast
* feat(cli): add orca vm env doctor to check a workspace environment
Checks required CLIs (git plus what the repo manifests imply), agent CLIs
and their sign-in, Git fetch and a dry-run push, the orca.yaml setup script
(optionally re-running it with Orca's runner), and free disk. Pass/warn/fail
with --json; checks live in src/main/environment-doctor for runtime reuse.
* fix(env-doctor): ship the doctor modules in the packaged CLI and share the check formatter
* fix(env-doctor): run Git probes in the C locale so folder detection is locale-independent