A create or new environment with nothing pinned used to start in pdx1 whatever the caller's location,
and every frame of a remote session paid that round trip. Now the sandbox-control Worker ranks the
served regions (the default and its fallbacks with an active golden) by distance from Cloudflare's
request geolocation and starts in the nearest.
- Explicit regions (request, API project) and an environment's build region stay authoritative.
- Environments record their region (migration 0061): builds, golden refreshes, staleness and the
security floor use it, so snapshots stay bootable and workspaces from them stay together. Legacy
environments (NULL) live in the default region as before.
- Automatic environments live where the create that made them ran.
- The capacity fallback tries the next nearest served region.
- The warm pool keeps VMs in every served region.
- VERCEL_NEAREST_REGION=off restores default-region-only.
- Desktop: the workspace card's Details shows the region (e.g. Portland (pdx1)).
Ask for Orca GitHub App access while the sandbox starts, not in a toast afterwards.
Server (sandbox-control):
- GET /v1/github/repo-access answers `push`: ok | not_installed | repo_not_selected |
not_connected, with `configureUrl` (the installation's settings page) for repo_not_selected.
A public repo that can't push now gets an install URL too.
- GitHub installation lookups (repo and new owner lookup) cached in D1 (migration 0061):
found 60 s, 404 15 s, dropped by installation / installation_repositories webhooks and the
setup return. The owner lookup never holds the answer (3 s cap, errors read as not_installed).
Desktop:
- "GitHub access" row after Start sandbox, checked when the create starts (parallel, so no
latency when access is fine). Missing: Install GitHub App / Add repository on GitHub /
Copy request for an owner, plus Skip for now ("You can pull; pushes need access later").
Polls (2 s for 3 min, then 10 s; on focus) and auto-advances on grant.
- The create holds before Open workspace only while the step asks and the sheet is on screen.
- Skip remembered per repo on this device; later creates show it skipped (Set up) without
holding; forgotten once the repo has access.
- A grant that lands after the sandbox started calls applyCloudGitHubAccessToSandbox, a stub
until gh-access's live refresh lands.
chatgpt.com answers Cloudflare Workers' egress with a 403 "Unable to load site" page, so Codex via
the Orca account could never get an answer through the egress proxy (#767 made that a printed
error). Cloud Run's egress is answered normally (probed, then deleted).
- cloud/apps/chatgpt-relay: a dependency-free Node relay. chatgpt.com only, the same Codex path
pinning as the Worker (shared sandbox-control/src/codex-paths.ts), SSE streamed chunk by chunk,
no WebSocket upgrades, hop and Cloud Run headers dropped, logs without headers, bodies or queries.
- Cloud Run IAM authenticates the Worker: one invoker service account (run.invoker on the relay
only); the Worker mints a Google ID token for the relay URL and sends it in
X-Serverless-Authorization, so the swapped ChatGPT Authorization passes through untouched.
- sandbox-control: CHATGPT_RELAY_URL + CHATGPT_RELAY_SERVICE_ACCOUNT route the egress proxy's
chatgpt.com fetches through the relay; unset, chatgpt.com goes direct as before. A relay
sign-in failure answers Codex a 503 JSON detail instead of reaching chatgpt.com.
- cloud/infra/chatgpt-relay: Terraform (staging backend applied; production is a runbook step).
Neil: the Orca Cloud GitHub App notice sank when hovered and popped back when the pointer left,
in a loop, and looked cut off while it did. Sonner sizes an expanded toast to the height it measured
when the toast was issued. The cloud toasts update their copy in place, so a card that grew after it
showed kept its first, shorter height: on hover it shrank from the top, sank 20px out from under
the pointer, collapsed and came back.
- cloud-toast-stack re-issues a card under the same id when its content changes, so sonner
measures it again (no re-add, no animation, same identity).
- The front toast keeps its natural height when the stack expands, as it does when collapsed, so
no toast can resize under the pointer however its content changed.
Positions are unchanged: the card sits 16px from the right edge and clear of the status bar.
Regression: fixture orca-cloud/CloudToastHover:grownAfterShowing fails before (766→786) and passes
after; a unit test pins the re-issue.
Neil got "Forwarded :34719 to localhost:34719 · codex · sand23 · Open": Codex's own listener on an
ephemeral port, forwarded and announced as if it were his app. Auto-forward now skips:
- a listener whose process is an agent CLI (claude, codex, opencode, gemini, cursor-agent, …; by
binary name, path, .exe or platform suffix), on any port;
- an anonymous ephemeral port (>= 32768) with no known web protocol and no URL the workspace
printed: an agent's MCP child, a language server, a debugger.
Dev servers keep auto-forward: usual ports (3000, 5173, 8080, …) and any port whose URL the terminal
printed. An earlier auto forward of an agent port retires once idle, as for any non-candidate.
The toast says what happened in the user's terms: "Your app on port 3000 is available at
localhost:3000", and "3 apps are available on this computer" for several.
OpenCode's first run in a VM installs its plugin SDK into ~/.config/opencode, creates its database and fetches its model list (first launch 5.2 s vs 2.7 s warm; in a pane on a fresh VM ~11 s, with the opencode process starting 0.7 s after the click, so the time is OpenCode's own). orca-sandbox-start now runs `opencode models` (does all of it, no credentials, exits) in the background at nice 19 right after orca-sandbox-env writes the config, only while ~/.config/opencode/node_modules is missing (once per disk; wakes skip it).
Neil: an Orca Cloud part inside Settings › Agent accounts was confusing. The Claude and ChatGPT
sign-ins for cloud workspaces (set up, paste a token, renew, remove) are now their own page in the
Orca Cloud group, right after Account & billing. Agent accounts keeps This computer and Hosts and
one row, "Orca Cloud sign-ins live in Orca Cloud settings", that opens the new page.
Every deep link moves with it: Renew in Settings, the sign-in sheet's footer, the host panel, and
old links to pane 'accounts' at 'orca-cloud' / 'accounts-orca-cloud' (resolveCloudAgentSignInsTarget).
Copy that sent people to "Settings → Agent accounts" for Orca Cloud now says "Settings → Cloud agent
sign-ins" (new i18n keys so stale translations don't point at the old place), including
sandbox-control's expired-Claude and RS-4 Codex messages. Search: the Orca Cloud keywords
(subscription, chatgpt, setup-token, renew) move to the new page. Behavior is unchanged.
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.
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.
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.
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.
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.
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.
"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.
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.