Commit Graph
23415 Commits
Author SHA1 Message Date
Neil dca419d3fd fix(cloud): CODEX-EGRESS-BLOCKED say so when chatgpt.com refuses the egress proxy
chatgpt.com answers every request from Cloudflare Workers' egress IPs with a 403 "Unable to load
site" HTML page, whatever the token (verified from a throwaway Worker; the same request from
elsewhere gets a normal 401). Codex via the Orca account goes through the Worker egress proxy, so
it got that page on /responses and /wham/usage: "Working…" without an answer, and /status had no
limits.

The proxy now recognises a provider edge's own refusal (403, text/html, server: cloudflare) on
routes that define an answer for it, logs egress_upstream_blocked, and answers Codex in ChatGPT's
error shape so Codex prints a plain message. The block says nothing about the credential: no
status hook, so no refresh and no revoke. This doesn't make Codex work; routing chatgpt.com around
the Worker is a separate decision.
2026-11-15 00:09:55 -08:00
Neil 10a4ea3db6 Merge pull request #765 from nwparker/cloud/cloud-env-unique-name
fix(cloud): a second cloud workspace from the same repository opens (unique server name)
2026-11-15 00:00:48 -08:00
Neil 0dd78f9aa5 fix: counter starts at 2 without a W-number 2026-11-14 23:56:43 -08:00
Neil dca6007901 fix(cloud): a second cloud workspace from the same repository opens instead of "Couldn't open the workspace on the sandbox"
Root cause (dev repro, deterministic): this computer saves each cloud workspace as a server named
"<title> (cloud)", server names are unique, and two workspaces from one repository share a title.
The second pairing failed with "A server named "xterm.js (cloud)" already exists." (verified with
a fresh grant on W-715: that name refused, a unique one paired in 550 ms), surfaced as "Couldn't
connect this computer to the workspace" / "Couldn't open the workspace on the sandbox".

A taken name now gets the workspace's W-number ("xterm.js W-715 (cloud)"), then a counter, using
the same collision rule the server store applies.
2026-11-14 23:52:10 -08:00
Neil 0f9fb98f07 Merge pull request #764 from nwparker/cloud/sc-deadlines-retry-observability
fix(sandbox-control): 20 s provider deadline, one retry for stalled reads; dev Worker keeps its logs
2026-11-14 23:46:21 -08:00
Neil ecfce3c737 Merge pull request #760 from nwparker/cloud/fetch-access-notice
fix(cloud): GH-FETCH-REASON the can't-reach-GitHub notice says why and offers the fix
2026-11-14 23:43:25 -08:00
Neil c24f97588e fix(sandbox-control): 20 s provider deadline, one retry for stalled reads; dev Worker keeps its logs
team-lead follow-up to #762: lookups/updates now fail at 20 s; a GET that hits the deadline is asked once more (a stalled write is never repeated: it may have landed); each stall logs provider_stall with the call's shape. orca-sandbox-control-dev turns on Workers observability so provider_stall, grant_failed and lifecycle_timing are retained.
2026-11-14 23:40:25 -08:00
Neil 6f1bbcfc55 Merge pull request #763 from nwparker/cloud/golden-agent-prefetch
perf(golden): prefetch the agent CLIs into the page cache at boot
2026-11-14 23:22:32 -08:00
Neil 6a02019931 chore(golden): regenerate the Worker-embedded VM scripts 2026-11-14 23:20:02 -08:00
Neil 845e495128 perf(golden): prefetch the agent CLIs into the page cache at boot
A fresh VM pages the agent CLIs in lazily from its snapshot, so the first agent launch paid for it (OpenCode 11 s cold vs 3.75 s warm in the same VM, n71). orca-sandbox-start now reads the claude, codex and opencode packages (files over 256 KB) in the background at nice 19 / idle IO, detached, after orcad starts; never on the ready path. Best effort.
2026-11-14 23:17:54 -08:00
Neil 6ea618d883 Merge pull request #762 from nwparker/cloud/sc-provider-deadlines
fix(sandbox-control): deadlines on every Vercel API call; slow grants log their phases
2026-11-14 23:16:46 -08:00
Neil 027fc090d5 fix(sandbox-control): deadlines on every Vercel API call; slow grants log their phases
Two dev failures (n70/n71) were the Worker waiting on a stalled Vercel API connection with no
client-side deadline: a create spent ~2 min before its write-ahead insert ("Start sandbox" stuck),
and POST /v1/team/workspaces/:id/grants (opening a new workspace on this computer) hung its full
120 s (wallTime 119995 ms, no response) although its VM command is bounded at 45 s.

- Every provider request now has a deadline: 30 s for lookups and updates, 60 s to boot a VM,
  5 min to snapshot, a command's own timeout + 20 s, and 3 h only for an explicit unbounded wait
  on a build's exit. A stall becomes a provider error the callers already handle (grant_failed,
  the create fallback), instead of an open-ended wait.
- issueGrant logs its phases (session, grant command, member git) when it takes over 10 s, and
  logs grant_failed with its timings and error, so the next slow open names its phase.
2026-11-14 23:14:24 -08:00
Neil 693bc2497f Merge pull request #761 from nwparker/cloud/agent-start-status
feat(cloud): "Starting Claude…" instead of a blank cursor; no "Asleep" flash on a new workspace
2026-11-14 22:48:53 -08:00
Neil 5386fc3acb feat(cloud): "Starting Claude…" instead of a blank cursor; no "Asleep" flash on a new workspace
Neil (n70): after creating a cloud workspace with Claude, the pane showed a blank terminal with a
cursor before Claude appeared. On a cloud host the agent starts behind a shell whose echo is
erased, so from the pane attaching until the agent's first frame there is only a cursor.

- A launched agent's pane shows "Starting <agent>… Ns" (centred, quiet) until the terminal draws
  any text, after a 600 ms grace so fast starts never flash it; past 20 s it adds "Taking longer
  than usual…". Only on the tab's agent leaf, only for a launch under 3 minutes old (a reattach of
  an older session is not a start), and never over the process-exit overlay, so a failed start
  shows its error.
- A just-created paired cloud workspace no longer flashes "Asleep · Wake to continue" before its
  agent tab opens: without a status read, "sleeping" only meant no pane was open yet.
2026-11-14 22:45:05 -08:00
Neil d9534be69d fix(cloud): GH-FETCH-REASON the can't-reach-GitHub notice says why and offers the fix
"This workspace can't reach <repo> on GitHub right now" with Check again read as transient even
when Orca's GitHub app simply can't see the repository.

- The doctor's git.fetch failure carries a code from git's own words: remoteDenied,
  remoteNotFound, remoteUnreachable (none for wording it doesn't know).
- The line asks the control plane's repo access, like the push line:
  - the app can't see the repo: "Orca's GitHub app doesn't have access to <repo>." with Grant
    access (the app's install page for that repo), or a request to copy for an owner;
  - the app can see it but GitHub refused this workspace (installed after it started): Restart;
  - the network, or no answer yet: the old words with Check again.
- After Grant access, the recheck drops the line once origin answers.
2026-11-14 22:22:42 -08:00
Neil 359288400d Merge pull request #758 from nwparker/cloud/gh-anon-403
fix(cloud): GH-ANON-403 member GitHub identities no longer 403 anonymous git to github.com
2026-11-14 22:15:50 -08:00
Neil 6b05760eb7 fix(cloud): GH-ANON-403 member GitHub identities no longer 403 anonymous git to github.com
A workspace on a public repo the Orca GitHub App isn't installed on gets no App token, so its git
sends no credential. When a member had connected GitHub, their placeholder rules made github.com a
credential host, and compileNetworkPolicy ended it with the firewall's 403: the doctor's
`git ls-remote origin HEAD` failed ("This workspace can't reach <repo> on GitHub right now"), and so
did every plain fetch and pull.

- With no App token, the member github.com route is allowUnclaimed. With a token the workspace git
  route keeps github.com fail-closed as before. api.github.com is unchanged.
- A wake rewrites the policy when member identities apply: a resumed session keeps its last
  policy, so a workspace created before this fix would otherwise keep the 403.
2026-11-14 22:12:45 -08:00
Neil 3f75c4d1a1 Merge pull request #757 from nwparker/cloud/codex-device-code-hint
feat(cloud): Codex device-code step: proactive device-code-sign-in hint
2026-11-14 21:58:40 -08:00
Neil afd7b98169 fix: one import for the accounts copy 2026-11-14 21:54:47 -08:00
Neil cb29da40db feat(cloud): Codex device-code step says up front how to turn device code sign-in on
One quiet line under the code in the Set up once strip and in Settings › Orca Cloud: "If OpenAI says device code sign-in is off, turn it on in ChatGPT → Settings → Security, then try again." The RS-3 failure (device_auth_disabled) keeps its own warning copy.
2026-11-14 21:53:04 -08:00
Neil c228ad9984 Merge pull request #756 from nwparker/cloud/wake-type-ahead-enter
feat(cloud): typing during a wake is type-ahead, Enter included
2026-11-14 21:39:02 -08:00
Neil 029612c109 feat(cloud): typing during a wake is type-ahead, Enter included
An Enter typed while a cloud sandbox wakes now reaches the woken shell in order with the rest of
the held keys, so the command runs (Neil: "whatever is more natural"). Before, Enter was dropped
and a toast said "Press Enter to run it"; that toast is gone. Lines after an Enter are kept in
order rather than dropped as a multi-line paste. Backspace and Ctrl-C edit only the line not yet
entered.

Unchanged guards: held keys go only to the pane they were typed in, after its transport
re-attached to the woken terminal (or the wake said ready), are removed before sending so they go
out exactly once, and are dropped with the existing "Your typing wasn't sent." notice when the wake
fails, nobody settles it within 90 s, or the pane never re-attaches.
2026-11-14 21:34:23 -08:00
Neil 7b5504d2ee Merge pull request #755 from nwparker/cloud/secrets-kms-tf-aliases
infra/secrets-kms: keep gcloud-set escrow version aliases
2026-11-14 21:31:06 -08:00
Neil f52303e359 fix(infra/secrets-kms): ignore escrow version aliases/annotations set by gcloud (plan was clearing k2 alias) 2026-11-14 21:29:13 -08:00
Neil 786e3064e3 Merge pull request #753 from nwparker/cloud/secrets-kms-dev
SEC-3: KMS-wrapped secrets KEK on dev (Terraform root + plaintext-KEK migration opt-in)
2026-11-14 21:24:39 -08:00
Neil c3f06d4afc Merge pull request #754 from nwparker/cloud/console-signin-toast-test
test(cloud): console sign-in-failed toast trigger
2026-11-14 21:18:19 -08:00
Neil baddd9b4f1 test(cloud): console sign-in-failed toast fires only for a signed-in desktop's failed or rejected ticket
openedResult (main) maps a missing or off-origin ticket to ticketError only when a ticket was asked for; openCloudConsole (renderer) warns on ticketError and stays quiet when signed in or signed out.
2026-11-14 21:15:04 -08:00
Neil 2400ca2cd9 Merge pull request #750 from nwparker/cloud/snapshot-leaks
fix(sandbox-control): no snapshot leaks on any delete path; nothing deletes a snapshot still in use
2026-11-14 21:10:13 -08:00
Neil f637ad8cfb Merge pull request #752 from nwparker/cloud/share-ws-keepalive
fix(sandbox-control): share-link WebSockets get a keepalive ping under Vercel's ~340 s idle cut
2026-11-14 21:08:14 -08:00
Neil 347c8daacd Merge pull request #749 from nwparker/cloud/team-list-ticket-origin
feat(cloud): drop the sidebar Team list; console tickets accept auth's advertised console origin
2026-11-14 21:05:48 -08:00
Neil 0ac81312e3 Merge pull request #751 from nwparker/cloud/command-once
fix(sandbox-control): a retried sandbox command never runs twice (agent messages, launches)
2026-11-14 21:03:22 -08:00
Neil 797aaeb178 feat(sandbox-control): SEC-3 KMS turn-on for dev: Terraform root for the KEK wrap key, plaintext-KEK migration opt-in
- cloud/infra/secrets-kms: own Terraform root and state (terraform/secrets-kms) for the Cloud KMS key
  that wraps the secret-store KEK, the Worker's decrypt-only service account, KMS/Secret Manager
  data-access audit logs and the KEK escrow secret. Applied to onorca-cloud-staging (dev Worker).
- SECRETS_KEK_PLAINTEXT_RETIRED_ID: in kms mode, also open rows under that id with the plaintext
  SECRETS_KEK as a retired key, only after KMS handed over the active KEK. Neither dev nor prod has a
  copy of its KEK outside Cloudflare, so the KEK can't be wrapped; this lets the rewrap sweep move
  rows onto a new KMS-held KEK instead. Never seals, never stands in for KMS (tests).
- wrangler.dev.jsonc: SECRETS_KEK_SOURCE=kms, SECRETS_KMS_KEY, SECRETS_KEK_ID=k2.
2026-11-14 20:58:28 -08:00
Neil 0148e0c48c fix(sandbox-control): share-link WebSockets get a keepalive ping under Vercel's ~340 s idle cut
Every Orca socket into orcad already gets a WS ping every 10-15 s (orcad's server heartbeat and the
desktop's client liveness). Share links were the gap: the in-VM share proxy piped upgraded sockets raw, so
a preview app's silent WebSocket was closed by Vercel after ~340 s (1006), well before the link's
deadline. The proxy now follows the app's frame boundaries and, after 30 s with no traffic either way,
sends the visitor an empty ping frame between two frames (never inside one). Only 101 upgrades to
websocket get pings; other upgrade protocols stay a raw pipe.

VM script: reaches live VMs through the boot-time entry-point sync (new stamp), and the next golden.
2026-11-14 20:57:31 -08:00
Neil 44595111e2 fix(sandbox-control): a retried sandbox command never runs twice (agent messages, launches)
Vercel's command POST has no idempotency key, so a retry after a lost answer (dropped connection, gateway
5xx, a Worker that died mid-request) can start the command again (vercel/sandbox#363). Message delivery
did exactly that: a transient failure re-queued the message and the cron typed it into the agent again,
or launched a second agent.

- command-once.ts: an in-VM guard with a per-id ledger (mkdir claim, recorded exit + output). A repeat of
  the same id waits for and replays the first run; a dead first run reports an unknown outcome; a failed
  run is forgotten so a retry runs for real. runCommandOnce retries uncertain provider failures with the
  same id (never a 4xx that proves the command did not start).
- deliverMessage uses msg-<id> for send/launch; an unknown outcome fails the message
  (delivery_outcome_unknown) instead of re-sending.
- POST /messages and POST /sessions take Idempotency-Key (same semantics as workspace create); a session
  create taking over a died attempt replays the first launch.
- The REST client keeps sending each command POST exactly once (test).
2026-11-14 20:57:30 -08:00
Neil bde0bed3ce fix(sandbox-control): no snapshot leaks on any delete path, and nothing deletes a snapshot still in use
- snapshot-refs.ts: one check for what live things still boot from (goldens of any live status, pool
  images, active environment builds, live workspaces' own snapshots, and a live workspace's boot image
  until it has a snapshot of its own).
- Retired goldens beyond the rollback and deleted environments' builds are marked deleted only after the
  provider delete succeeded (a failed delete used to be marked and leaked for good), and are deferred
  while in use. A new hourly housekeeping step (sweepReleasedSnapshots) retries both.
- Team delete marks the team's environments deleted, so their build snapshots are freed (they leaked).
- Environment prune skips a build a live workspace still boots from.
- Orphan sweeps (per box and project-wide automatic) also respect pool and boot-image references.
- The golden smoke box is non-persistent: it no longer leaves a ~325 MB automatic snapshot behind.
2026-11-14 20:57:17 -08:00
Neil 5211f340aa feat(cloud): drop the sidebar Team list; console tickets accept auth's advertised console origin
The sidebar's Team list (PARITY-FOLLOW #652) is gone; the team view moves to the web console.
Following stays (now SidebarFollowingPanel/SidebarFollowingSection, the followed-workspaces
model). Its roster read, teammate activity model, cap, tests, fixtures and copy are deleted;
teammate profiles and the top-bar people are untouched.

Console links: n68 rejected tickets minted on console-staging.orca.dev because the allowlist was
only ORCA_CLOUD_CONSOLE_URL (app-staging) and the auth origin, so Team opened the bare console.
Auth now advertises `capabilities.consoleOrigin`; main accepts a ticket on that exact origin too
(https only, an origin and nothing more; the existing exact-match and no-userinfo guards stay), and
uses it for the no-ticket fallback. When a signed-in desktop's ticket fails or is rejected, the page
still opens but a toast says the console sign-in failed, instead of a silent sign-in page.
2026-11-14 20:50:58 -08:00
Neil ace88d146c Merge pull request #748 from nwparker/cloud/plans-hint-retry
fix(cloud): console ticket retries once without the billing hint on a 400
2026-11-14 17:29:46 -08:00
Neil c56d801669 fix(cloud): console ticket retries once without the billing hint on a 400
Belt and braces for the capability gate: an auth that advertises console.billing_hint but refuses the fields (rollback, early flag) still mints a ticket, so the console opens signed in without the preselect.
2026-11-14 17:25:32 -08:00
Neil cf7c422a20 Merge pull request #747 from nwparker/cloud/plans-followups
feat(cloud): plans dialog passes the picked plan to the console; blocker copy after Compare plans
2026-11-14 17:24:50 -08:00
Neil 3b2e8b2e57 feat(cloud): plans dialog passes the picked plan to the console; blocker copy after Compare plans
"Continue in browser" sends the plan and billing period picked in the plans dialog with the
console ticket ({page:'billing', plan, interval}) so the web billing page can preselect them. Main
adds the fields only when auth advertises the `console.billing_hint` capability: the ticket route
takes a strict body, and an older auth would refuse them and lose the signed-in landing. The
renderer's hint is re-validated in main (plan id pattern, month|year, billing page only).

The build sheet's no-plan blocker, after Compare plans, no longer says "Finish in your browser":
it says to choose a plan and check again, with See plans to reopen the dialog. Update payment
method keeps going straight to the console.
2026-11-14 17:20:03 -08:00
Neil dbf56b3994 Merge pull request #746 from nwparker/cloud/plans-modal
feat(cloud): plans dialog before the web console; billing serves each plan's card copy
2026-11-14 17:07:40 -08:00
Neil 7b7f4e26d2 test(cloud): plan entry points open the plans dialog 2026-11-14 16:51:57 -08:00
Neil 756a89c83f fix(cloud): plans dialog lint and catalog keys 2026-11-14 16:41:16 -08:00
Neil f2888317b4 feat(cloud): plans dialog before the web console; billing serves each plan's card copy
"Plan & billing", "Upgrade to Orca Cloud", "Choose plan" and every "Compare plans" now open an
in-app plans dialog first: the team's plan and status (trial hours left, active with hours and
seats, payment failed, or no plan with the trial billing offers), then billing's plan cards (Team
with a monthly/annual toggle, Enterprise with contact sales). "Continue in browser" opens the
console's billing page through the existing sign-in ticket. Members see the same plan info with
"Ask a team admin to upgrade" (Plan & billing is back in their account menu, read-only). Read-only:
no checkout, usage history or admin settings return to the desktop.

Everything shown is billing's: names, Stripe prices, seat pricing, feature bullets and trial terms
from GET /v1/plans, now also each plan's tagline, feature-list lead and button label (new optional
catalog `marketing`, unversioned copy, plus `omitFeatures` so Enterprise stops advertising egress
controls). Main's lenient parse keeps a newer or older service safe; without the catalog the
entitlement's offers stand in, and with neither the dialog says plans didn't load and still offers
the console. While billing loads the title is neutral, so a paying team never sees an upsell flash.

Settings > Account's billing row opens the dialog ("View plans"); "Update payment method" still
goes straight to the console.
2026-11-14 16:37:59 -08:00
Neil 0fdef56140 Merge pull request #745 from nwparker/cloud/endpass-p3-routine-cli
fix(cloud): routine run Claude sign-in copy in the CLI (follow-up to #744)
2026-11-14 05:21:50 -08:00
Neil bc7b4e1e04 fix(cloud): routine run sign-in copy for the CLI too (desktop Routines UI is parked)
The desktop's Routines settings are behind CLOUD_ROUTINES_UI_ENABLED=false, so the CLI
(orca cloud routine run) is where people read a run's result. A run that failed with Claude's
own "Not logged in · Please run /login" now says Claude isn't set up for Orca Cloud and where to
set it up, and doesn't repeat the raw summary. The detection moves to src/shared so both surfaces
use one rule.
2026-11-14 05:18:27 -08:00
Neil 3fa3d228bc Merge pull request #744 from nwparker/cloud/endpass-p3-polish
fix(cloud): END-PASS n64 P3 polish (billing row for admins, archived bar, routine sign-in copy, no reattach banner on Sleep/Archive)
2026-11-14 05:14:50 -08:00
Neil b74f8f1a0d fix(cloud): END-PASS n64 P3 polish: Plan & billing for team admins only, archived terminal bar, Claude sign-in copy for routine runs, no reattach banner during a deliberate Sleep/Archive
- Plan & billing (Settings › Account and the account menu, including Upgrade) shows only to an
  owner or admin of the active team: the console's own rule (canManageMembers on
  /console/orgs/:id/billing). Members were offered a row the console then refused.
- An archived workspace's terminal bar says it's archived and offers Unarchive (was: asleep, Wake).
- A routine run whose agent exited with Claude's "Not logged in · Please run /login" says Claude
  isn't set up for Orca Cloud and where to set it up, instead of the CLI's text.
- A Sleep or Archive the person chose holds the terminal reconnect notices from the press until a
  wake starts (or 90 s): a paired workspace's status lags the sleep call, and in that gap a pane
  said "Reattaching terminal · Down for 10 sec".
2026-11-14 05:02:39 -08:00
Neil 01990543e5 Merge pull request #743 from nwparker/fix/cloud-only-name-not-prompt
fix(cloud): GitHub-only composer name is never sent as the agent's prompt (CLOUD-ONLY-NAME-AS-PROMPT)
2026-11-14 04:10:40 -08:00
NeilandClaude a305ac73d9 test(cloud): type the launch mock instead of asserting (CLOUD-ONLY-NAME-AS-PROMPT)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-14 04:05:39 -08:00