Commit Graph
23547 Commits
Author SHA1 Message Date
Neil 36303ac480 fix(cloud): GH-AS-MEMBER gh wrapper actually runs: the real gh moves off PATH (tools/gh/bin) and tools/bin/gh links to the wrapper; older images migrated at entry-point install 2026-11-15 22:37:07 -08:00
Neil 9d369ff270 Merge pull request #812 from nwparker/cloud/gh-as-member
fix(cloud): GH-AS-MEMBER PRs, comments and pushes from a cloud workspace show as the member, not the bot
2026-11-15 22:31:29 -08:00
Neil f26bcb958f Merge pull request #814 from nwparker/cloud/tab-chip-delete-labels
fix(desktop): remove the W-number tab chip; delete dialog says Archive / Delete
2026-11-15 22:22:29 -08:00
Neil 42c102137a fix(desktop): drop the W-number chip from the tab bar; delete dialog reads Archive / Delete
- The cloud workspace's W-number chip (CloudWorkspaceNumberChip) is gone from the workspace tab
  bar and the titlebar strip; the component, its fixture and its two chip-only strings are
  deleted. Copying the workspace link stays on the sidebar's right-click Copy › Workspace link and
  ⌘⌥⇧L (cloud-workspace-links.ts), neither of which used the chip.
- Delete-workspace dialog buttons: "Archive instead" -> "Archive", "Delete workspace" -> "Delete"
  (same string in the cloud workspace list's confirm dialog).
2026-11-15 22:17:08 -08:00
Neil e994d835ba fix(cloud): GH-AS-MEMBER approve/merge path checks case-insensitive with optional trailing slash; an unread review body counts as an approval 2026-11-15 21:24:54 -08:00
Neil 3d96f7d720 fix(cloud): GH-AS-MEMBER approvals never as a member (any workspace); merges as a member only in a one-person workspace (incl. REST branch merges); approve event case-insensitive; shared cap default 60 min 2026-11-15 21:23:00 -08:00
Neil 67ab8991bf Merge pull request #813 from nwparker/cloud/connect-github-prompt
fix(settings): the GitHub row says pull requests and comments show as you too
2026-11-15 21:20:39 -08:00
Neil 730334b4f5 fix(cloud): GH-AS-MEMBER PRs, comments and pushes from a cloud workspace show as the member, not the bot
stablyai/orca#42960 (Neil, dev) was authored by orca-cloud-dev[bot]. Neil had connected GitHub; member
identities only reached git: gh ran on the workspace placeholder (the App's installation token), and
the Worker's member route on api.github.com allowed only REST under the repo while gh pr create is
GraphQL.

- VM: a gh wrapper runs gh with the attested sender's own placeholder (orcad attests, as for git);
  plain gh otherwise. Behind GH_AS_MEMBER=on (dev on).
- Worker, api.github.com with a member placeholder: the member's own token only for REST under the
  workspace repo and for allowlisted authorship mutations whose every target resolves to it
  (repositoryId equals its node id; other ids looked up with the installation token, cached per repo,
  failures not cached). graphql-js parse; variable defaults, owner-level projectIds, duplicate
  top-level keys and anything unexpected are not member requests. Everything else goes out on the
  installation token as before; an out-of-repo pinned mutation is refused with a GraphQL error.
- Shared workspaces never approve or merge as a member (GraphQL and REST): those go out on the
  installation token, so branch protection still applies.
- Identity rule: the only person who can use a workspace always acts; in a shared one the latest
  sender acts until another member sends, for at most MEMBER_GIT_SHARED_MAX_MINUTES (default 480).
- A GitHub connect or disconnect mid-session reaches the running VM's identities now.
- Tokens never enter the VM.
2026-11-15 21:18:00 -08:00
Neil bcc7a567c8 fix(settings): the GitHub row says pull requests and comments show as you too
GH-AS-MEMBER (#812): a connected member's PRs, comments and pushes from cloud workspaces now show as
them, not only commits. The settings row's connect and disconnect copy says so.
2026-11-15 21:14:13 -08:00
Neil 2a21ea6646 Merge pull request #811 from nwparker/cloud/create-gh-connect
feat(cloud): CREATE-GH-IDENTITY connect-your-GitHub line in the create wizard
2026-11-15 21:10:40 -08:00
Neil 19ceb2b61d Merge pull request #810 from nwparker/cloud/browser-public-direct
fix(cloud): CLOUD-BROWSER-DIRECT an Orca Cloud workspace's browser loads public sites from the desktop
2026-11-15 21:05:18 -08:00
Neil 780df8aacf test: typed fake instead of a cast 2026-11-15 21:03:08 -08:00
Neil e15a673ad3 feat(cloud): CREATE-GH-IDENTITY "Connect your GitHub so PRs show as you" in the wizard's GitHub step
Once the GitHub access step settles (ok, granted or skipped), a person who hasn't connected their
own GitHub sees "Connect your GitHub so PRs show as you." with Connect GitHub and Not now, in the
step's own style. It never holds the create.

- Reads GET /v1/github/user through the existing Settings hook (useGitHubIdentity): focus re-read
  and a light poll while the browser OAuth is open; "PRs from this workspace show as @login" once
  connected here. Already connected, or no answer (signed out, older control plane): nothing shown.
- Not now is remembered on this device (it's about the person, not the repo); Settings › Orca
  account still has Connect.
2026-11-15 21:00:17 -08:00
Neil 60774b0afc test(cloud): CLOUD-BROWSER-DIRECT test without type assertions 2026-11-15 20:59:03 -08:00
Neil 61ad429f1b Merge pull request #809 from nwparker/cloud/run-on-sticky
fix(composer): RUNON-STICKY Orca Cloud stays picked when the project changes
2026-11-15 20:57:49 -08:00
Neil c147346951 fix(cloud): CLOUD-BROWSER-DIRECT an Orca Cloud workspace's browser loads public sites from the desktop
Neil (n75, dev): the browser pane in a cloud workspace showed 'Connection isn't secure'
(ERR_CERT_AUTHORITY_INVALID) on github.com. A paired runtime's browser route sends every connection
through the VM (SOCKS on the desktop, dialed by orcad in the sandbox). An Orca Cloud sandbox's egress
terminates TLS for hosts that carry credential rules (github.com always does: the App token and member
routes), so Chromium on the Mac got a certificate from the sandbox provider's CA. It must never trust
that CA, and a public site never needs the sandbox anyway.

For Orca Cloud environments the route now sends only the workspace's own loopback through the sandbox
(localhost, *.localhost, 127.0.0.0/8, ::1: its dev servers and forwarded ports); every other site is
dialed from this desktop exactly like a local workspace's browser (the native dialer, honouring the
desktop's proxy settings and destination policy). Other paired runtimes and SSH/WSL routes are
unchanged.

(A PAC script can't express this: Chromium never consults PAC for loopback, measured on this Electron.)
2026-11-15 20:51:36 -08:00
Neil ab48dd17b4 test: no type assertion in the Run on pick helper 2026-11-15 20:51:36 -08:00
Neil dbef31ce68 fix(composer): RUNON-STICKY a picked Orca Cloud stays picked when the project changes
Picking "Run on: Orca Cloud" then another project reset Run on to this computer.
useEphemeralVmRecipeOptions reloads the project's recipes on every repo change with
load(resetSelection=true), which cleared the selection to null (Orca Cloud is the same for every
project, unlike a project's own orca.yaml recipes).

- A project change now carries Orca Cloud: it stays selected while the new project's options load
  (no flash to Local) and after, whenever the new project offers it.
- Only when the new project can't use it does Run on fall back, and a line under Run on says why:
  the project lives on another machine (SSH / remote server / not loadable here), Orca Cloud didn't
  answer, or it isn't offered for this project. The next pick clears it.
- A project's own recipe still doesn't carry to another project.

Tests: 5 new cases in useEphemeralVmRecipeOptions.test.tsx; 4 of them fail on the old hook.
2026-11-15 20:48:37 -08:00
Neil 02ca317237 Merge pull request #808 from nwparker/cloud/audit-per-domain
fix(cloud): provider-policy audit breaks rules down per domain; echo-probe reports the HTTP status
2026-11-15 20:42:49 -08:00
Neil 3136c355a9 feat(cloud): dev-only session-token-free probe route
Puts the token-free compile on a probe account's LIVE session, so the probe can see whether a
header-matched respond rule answers at all (separating 'respond not enforced' from 'resume restored
something else').
2026-11-15 16:04:50 -08:00
Neil 6314a21518 fix(cloud): provider-policy audit breaks rules down per domain; echo-probe reports the HTTP status
egress-docs' A4 run: after resume-raw the echo to the custom base-URL host answered 200 where the
token-free record should answer the placeholder 403. The Worker's token-free compile is right (the
host keeps its respond rules: checked in the harness), so the probe needs to see what Vercel holds
per host and what status came back:
- the audit adds domains: {host: {injection, forward, response}} (hostnames only);
- echo-probe returns the HTTP status again. The echoed body stays in a shell variable, never a file.
2026-11-15 16:04:05 -08:00
Neil bb8fc53fb8 Merge pull request #807 from nwparker/cloud/relay-warm
chore(cloud): keep one ChatGPT relay instance warm
2026-11-15 15:59:38 -08:00
Neil 46e3e31b69 Merge pull request #792 from nwparker/cloud/egress-refresh
feat(sandbox-control): EGRESS-REFRESH central credential refresh and push outbox
2026-11-15 15:43:41 -08:00
Neil 3131fbdc04 docs(cloud): relay README: the warm instance, and keeping it in production 2026-11-15 15:38:55 -08:00
Neil 7b3ff2df30 feat(sandbox-control): EGRESS-REFRESH central credential refresh and push outbox 2026-11-15 15:38:30 -08:00
Neil f16725a7d1 chore(cloud): keep one ChatGPT relay instance warm
A Cloud Run cold start cost Codex's first chatgpt.com call ~10.8 s on dev (seen twice on
2026-11-15, each right after an idle period). min_instance_count 0 -> 1 on staging (applied).
2026-11-15 15:38:11 -08:00
Neil 3cbc9bbe12 Merge pull request #804 from nwparker/cloud/egress-a4-scrub
feat(cloud): A4 stopped sandboxes keep no credential at rest in the provider
2026-11-15 15:36:47 -08:00
Neil 5a6532ca93 Merge remote-tracking branch 'private/cloud/integration' into cloud/egress-a4-scrub 2026-11-15 15:33:20 -08:00
Neil 602f923f1e Merge pull request #805 from nwparker/cloud/policy-audit-fixes
fix(cloud): provider-policy audit counts injection/forward/response rules; dev resume-raw and echo-probe
2026-11-15 15:33:08 -08:00
Neil 431024a4c9 Merge pull request #783 from nwparker/cloud/archive-teardown-hook
feat(cloud): run the repo's archive hook in the VM before archiving or deleting a cloud workspace
2026-11-15 15:13:08 -08:00
Neil 5210eca04f fix(cloud): echo-probe writes nothing in the VM; resume-raw/echo-probe only on probe accounts
egress-docs' review of #805: the echoed request goes straight into grep -c (a swapped value never
touches the VM's disk), and both routes refuse any row outside the throwaway probe accounts
(account_id dev:egress-…).
2026-11-15 15:03:50 -08:00
Neil 7da2415f79 fix(cloud): A4 review R2: a record scrub never strips a workspace that resumed meanwhile; R4 note
scrubStoppedRecord re-reads the row right before the PATCH and only scrubs one that is still
suspended or archived with no session; if the row resumed while the PATCH was in flight, the live
policy is re-applied at once (reason scrub_race). Failed rows are left out of the sweep on purpose:
failAndRelease destroys their provider sandbox.
2026-11-15 15:02:05 -08:00
Neil 326340b8cd fix(cloud): provider-policy audit counts injection/forward/response rules; dev resume-raw and echo-probe
egress-docs' probe 2 re-run through #803 found transformRuleCount always 0: Vercel's redacted shapes
name header swaps injectionRules (session) next to forwardRules and responseRules. The audit now
reports each kind separately (count + header names), so a scrubbed policy is checkable: 0 injection
rules, response rules only.

Two more dev-only operator routes so the probe needs no personal Vercel login:
- POST …/resume-raw: resume the provider session from its stored record with no policy write of
  ours (the row is left as it was; dev throwaways only).
- POST …/echo-probe?marker=orcaprobebogus…: one fixed request from inside the VM to httpbin.org
  or postman-echo.com carrying a placeholder header (placeholders only, validated); the answer
  is whether the echo contained the marker. No body comes back or is logged.
2026-11-15 15:00:25 -08:00
Neil 97c12b73f7 fix(cloud): A4 the post-resume policy write retries with backoff, and a lasting failure is visible
A wake resumes from the scrubbed record, so until its policy write lands the firewall answers the
placeholders itself (the keys-withheld or signed-out errors agents print). The write now retries
(250 ms, 1 s, 3 s); if it never lands, the wake still completes (fail closed, never a hang), logs
policy_apply_failed {reason: boot} by code, and marks policy_stale_at for reconcile's next tick.
2026-11-15 14:58:22 -08:00
Neil 2890043707 fix(cloud): drop the untranslated archive hook toast description 2026-11-15 14:57:56 -08:00
Neil a5deecca4b cloud: renumber the archive hook migration to 0064 (0063 landed concurrently) 2026-11-15 14:57:55 -08:00
Neil 4b311e95f3 fix(cloud): unattended archives bound the hook to 30 s; an archived workspace is never offered a wake for it 2026-11-15 14:57:54 -08:00
Neil 24de08a2a5 fix(cloud): a failed archive hook run after a successful one makes it pending again 2026-11-15 14:57:52 -08:00
Neil cc5211efd9 cloud: renumber the archive hook migration to 0063 (0062 landed concurrently) 2026-11-15 14:57:51 -08:00
Neil a2551a3190 fix(cloud): archive hook picks checkouts in git's worktree order (the primary is listed under its real path) 2026-11-15 14:57:51 -08:00
Neil 0cd490186d feat(cloud): run the repo's orca.yaml archive hook in the VM before archiving or deleting a cloud workspace
Archive and delete stop the VM but nothing it started elsewhere (a preview
database branch keeps billing). The control plane now runs scripts.archive
on the still-running VM: bash with set -e, as the user, with the session's
env and secrets, 2 min for all checkouts, output per checkout and in
~/.orca-sandbox/archive-hook/archive.log.

- POST/GET /v1/sandboxes/:id/archive-hook; migration 0062 remembers whether
  the repo has a hook (learned at each sleep) so an asleep archive/delete can
  offer a wake for it, and never wakes one without a hook.
- Desktop archive runs it before the Sleep; a failure shows the output with
  Archive anyway / Keep it. Asleep: the Undo toast says it wakes first and
  offers Skip hook.
- Asleep/unreachable delete runs it through the control plane; a failure
  refuses with the usual Delete anyway waiver.
- Unattended archives (public API, team list) run it on a running VM and
  archive even if it fails (logged).
- Docs: orca.yaml scripts.archive for Orca Cloud workspaces.
2026-11-15 14:57:51 -08:00
Neil 4df5205c66 feat(cloud): A4 stopped sandboxes keep no credential at rest in the provider
Probe 2 (egress-docs): a session's last network policy survives a stop or a timeout on the
persistent record and is re-applied on resume, so firewall-mode values would sit at rest in Vercel
while a workspace sleeps.

- After every voluntary stop (sleep, rollover, restart, archive) and when reconcile finds the
  provider stopped a session (timeout), the record is PATCHed with the token-free compile (same
  routes, every firewall value answered by the firewall, no App token). A failed PATCH sets
  policy_scrub_pending.
- Reconcile scrubs stopped rows that are pending, or whose last policy carried a firewall class and
  was written after their last scrub (timeouts, crashes, and a one-time sweep on deploy).
- A wake PATCHes the record with the full policy right before resuming (no gap); the post-resume
  apply stays as the backstop.
- Boots stamp policy_config_hash (and a generation one below now), so create and wake writes are
  covered like applies. Proxy-only policies hold no values: nothing to scrub, no record writes.
- Migration 0067 (0064 and 0066 are held by #783 and #792): policy_scrubbed_at,
  policy_scrub_pending.
2026-11-15 14:56:20 -08:00
Neil 4b348f1df6 Merge pull request #803 from nwparker/cloud/provider-policy-audit
feat(cloud): dev-only redacted provider-policy audit, and A4's record scrub primitive
2026-11-15 14:52:48 -08:00
Neil 7ea40ac042 feat(cloud): dev-only redacted provider-policy audit, and A4's record scrub primitive
For egress-docs' probe 2, re-run on the Worker's own Vercel token (dev only; elsewhere these routes
don't exist; operator token):
- GET /v1/internal/sandboxes/:id/provider-policy-audit?marker=orcaprobebogus…: the raw record and
  session read from Vercel, answered as redacted facts only (state, session status, whether a
  network policy is present, transform rule count, header names, markerFound by substring test).
  No value or body is returned or logged.
- POST /v1/internal/sandboxes/:id/provider-policy-scrub-test: A4's primitive, scrubRecordPolicy,
  which PATCHes the persistent record with the token-free compile (every firewall value answered by
  the firewall, no App token; proxy routes hold no values anyway).

compileSandboxPolicy gains { tokenFree }; the provider gains updateRecordNetworkPolicy and a
dev-audit raw read.
2026-11-15 14:27:41 -08:00
Neil 348af764e8 Merge pull request #802 from nwparker/cloud/no-cross-request-promises-2
fix(cloud): WORKER-XREQ-PROMISE sweep: JWKS, the policy chain, the keyring, and a guard
2026-11-15 14:27:36 -08:00
Neil c90ba953af fix(cloud): WORKER-XREQ-PROMISE sweep: JWKS, the policy chain, the keyring, and a guard
Follow-up to #801: the rest of the Workers' shared in-flight promises.

- Auth (sandbox-control desktop, staging and dev keys; billing) and the egress proxy's OIDC keys used
  jose's createRemoteJWKSet, which shares one in-flight JWKS fetch across every caller: a request
  cancelled mid-fetch hung every token check behind it, and jose refetches after ten minutes. That
  fits the 'Start sandbox' creates stuck before any log 10–15 min after a deploy and cleared by a
  redeploy. settledRemoteJWKSet keeps the key set as a value; a request that needs a fresh one
  fetches it for itself (refetch every 10 min, an unknown kid at most every 30 s).
- applySandboxPolicy no longer chains writes per sandbox in the isolate (a chained promise from a
  cancelled request would hang every later write for that sandbox); the D1 generation orders them.
- The KMS keyring cache keeps the loaded keyring and the last failure as values; no in-flight load
  is stored at all.
- Guard (both Workers): a unit test fails on createRemoteJWKSet, or a module-level Map, variable
  or object holding a Promise, unless the line says why it is safe ('xreq-ok:', e.g. a WebCrypto
  import).
2026-11-15 14:24:44 -08:00
Neil 5feaf7df7c Merge pull request #801 from nwparker/cloud/no-cross-request-promises
fix(cloud): WORKER-XREQ-PROMISE module caches hold settled values, never another request's in-flight promise
2026-11-15 14:22:50 -08:00
Neil fc5c502bb5 fix(cloud): WORKER-XREQ-PROMISE module caches hold settled values, never another request's in-flight promise
Egress proxy secret routes (custom-base-URL keys, OPENAI_BASE_URL) hung until the client gave up
(dev, proxy mode, 2026-11-15). The Worker was invoked (tail: `canceled`, wall 65 s, CPU 3 ms, no log
line) and was waiting, never reaching its upstream fetch. GitHub routes on the same sandbox answered.

An isolate serves many requests, and a promise one request starts is bound to that request's I/O. If
that request is cancelled while the promise waits on D1, KMS or fetch, the promise never settles, and
every later request awaiting the same cached promise hangs. Several module-level caches shared
in-flight promises: the KMS keyring (forever, per isolate), decrypted provider keys and account
credentials (per minute), the relay's ID token mint, the App's pending-request owners, create timing
and share-link lookups.

They now cache settled values only (settled-cache.ts and the same pattern inline). A request that
misses loads for itself; a cold isolate may run a few duplicate loads.
2026-11-15 14:20:14 -08:00
Neil cd778ffc80 Merge pull request #800 from nwparker/cloud/egress-probe-modes
ci(cloud): egress probe in proxy and firewall modes (streams, uploads, WS, git, latency)
2026-11-15 13:57:15 -08:00
Neil da7fa7e164 Merge pull request #799 from nwparker/cloud/egress-review-fixes
fix(cloud): EGRESS review F1–F3 before any firewall canary
2026-11-15 13:54:44 -08:00