Commit Graph
17048 Commits
Author SHA1 Message Date
Neil 94651604b5 test(cloud): type the gone-sandbox retire test's sent list without a cast 2026-11-10 17:09:56 -08:00
Neil c3470c1371 fix(cloud): retire Orca Cloud records whose sandbox was destroyed elsewhere
A sandbox destroyed out of band (the team list's Delete for a workspace
this desktop doesn't run, or the control plane) left its runtime record,
server and project here. After a restart its clone came back as a stray
folder project with a "Couldn't start" row.

The team filing's list now runs at startup and every 10 minutes too, and
hands each successful list to a prune. A record filed under that team
that the list omits is retired only on proof: a second consecutive list
without it, or GET /v1/sandboxes/:id answering not found or destroyed.
Errors, offline, a team switch while confirming, a create in flight, or
another or unknown team's record never retire anything, and asleep
(suspended/archived) sandboxes stay listed so they are never touched.
Retiring follows the app's own delete: the record is cleaned and its
server released and retired, and the window's catalog refresh purges the
host's project and setup.
2026-11-10 17:04:28 -08:00
Neil a81304f534 fix(cloud): leave the old team's open cloud workspace on a team switch
A team switch hid the old team's sandboxes from every list, but the main
pane kept showing the one that was open. When the active workspace's host
goes from in-team to out of scope (team or account switch), clear the
active workspace as a host removal does; its terminals stay, since the
sandbox is still the old team's. Only that edge counts, so a launch whose
team or runtimes are still loading keeps a restored cloud workspace.
2026-11-10 16:54:42 -08:00
Neil 23c4fa300c fix(cloud): scope Orca Cloud workspaces to the active team; never list sandbox clones
Bug 6: a team switch left the previous team's cloud workspace in the
sidebar (as its own project header) and kept its lease scheduler, wake
and orcad calls running under the new team's token.

- Orca Cloud runtime records carry the owning control-plane account
  (cloudAccountId, sandbox-control's org:<id> / user:<id> form), read
  once at the create write-ahead from the active profile.
- Backfill: on the 30 s beat and on every auth change, list the active
  team's sandboxes (GET /v1/sandboxes is scoped to the caller's account)
  and file the listed records under that team; it re-lists only when the
  team or the unfiled set changes, and drops a list that answered for a
  team the user has since left.
- The session registry, OOM polling and the window's cloud workspace ids
  skip every record outside the active team, so the old team's sandboxes
  get no keep-alive or orcad calls after a switch.
- Sidebar rows, the jump palette and project headers hide another team's
  sandbox hosts and any whose team is unknown (or when signed out).

Bug 7 (per coordinator): every Orca Cloud sandbox's primary clone stays
hidden; each cloud workspace row appears once.
2026-11-10 16:26:48 -08:00
Neil c66cb01cf3 fix(cloud): hide Orca Cloud sandbox clones from the sidebar; no Tailscale hint for cloud hosts
Each Orca Cloud workspace is its own sandbox host whose clone is registered
as the project there (orca-worktree mode, hosted-sandbox-driver.ts), with
the workspace as a worktree beside it. The clone was listed as a primary
row, so every cloud workspace added another identical
'master [primary] · Orca Cloud' row under its project. Sidebar lists and
the jump palette now hide primary checkouts on Orca Cloud hosts, reusing
the VM-create hidden-checkout filter.

An unreachable Orca Cloud sandbox (asleep, gone, or another team's) was
classified as a network host and got the 'connect both devices to
Tailscale' hint; cloud hosts now keep the plain message.
2026-11-10 15:28:46 -08:00
Neil 06463860a4 fix(cloud-setup): a signed-out start asks for GitHub; a reachable repo finishes a waiting session's GitHub row
- Signed out, the composer can't check GitHub yet, so 'Set up and start' asked the session for the
  plan only. The browser then ended on 'You're all set' while the composer still needed GitHub.
  A GitHub project now always asks a signed-out session for GitHub; the chain marks it done on its
  own when access is already there.
- With the composer following its session, the session's GitHub row is the only source of truth.
  The control plane's notice to billing is best effort, so also take the desktop's own repo-access
  poll: once it reaches the repository, the GitHub row is done and the start goes ahead.
2026-11-10 14:39:19 -08:00
Neil ff64af20b0 fix(cloud-setup): the composer follows its setup session; billing reaches the control plane for GitHub
- The composer read the setup session with a bare readCloudSetupSession() call in render. The React
  Compiler memoizes that on the session id, so the panel kept its first (empty) read: rows never
  moved past 'In browser', the finished session never auto-started the workspace, and the GitHub
  row stayed 'Needed' after the browser said 'You're all set'. Read it through
  useCloudSetupSession (useSyncExternalStore with a per-poll cached snapshot) instead.
- Billing asked the control plane for the GitHub install URL with a plain fetch to its workers.dev
  origin. Same-account Workers can't do that (Cloudflare error 1042), so every setup GitHub step
  showed 'Orca Cloud setup is unavailable'. Bind the control plane as a service (SANDBOX_CONTROL)
  in the dev config and send the request through it when bound.

Found by the NP-4 end-to-end run (np4-e2e) on m4air against staging.
2026-11-10 14:32:37 -08:00
Neil c1cdd0db6e feat(cloud-setup): register Copy setup link and the team name with the setup tracker (np4-shell #260) 2026-11-10 13:34:57 -08:00
Neil c2386ad76d feat(cloud-start): "Finish in your browser" tracker, X1 errors, B2 switch-team row (NP-4)
- A6 tracker (CloudSetupBrowserTracker) on w2's OrcaCloudSetupPanel: steps tick in
  place, rows derived from billing show the first open row as "In browser",
  Cancel setup / Copy setup link / Reopen browser. Links come from a new seam
  provider (setCloudSetupLinkProvider) that np4-setup registers.
- X1 (CloudSetupErrorNotice): timed out, checkout canceled, bank step (3DS),
  trial unavailable (owner/member), team create failed, wrong account.
- B2 (CloudSetupSwitchTeam): on a personal account, a team with a plan replaces
  the plan row with "Switch to <team>" (a menu for several), using the account
  menu's switcher; Start is aria-disabled with "Switch to <team> first".
- Composer wiring in use-cloud-start-composer / ProjectSection / Footer, and
  time-to-first-sandbox telemetry at auto-start.
- Fixtures: B1, B2 (single + menu), X1 sheet, tracker states.
2026-11-10 13:32:10 -08:00
Neil 16b556023e fix(cloud): member-blocked billing states say who fixes it, per cause (design-squad) 2026-11-10 11:59:55 -08:00
Neil 0da0827470 fix(cloud): design-squad sweep: cloud environment-check sign-in copy from the Orca account; DS-33 fixtures (#302)
1. P1: on Orca Cloud the sandbox's own sign-in probe can't see an Orca-account sign-in (it holds
   placeholders), so the environment check's agent row now reads the account:
   - covered by the account or a key (orcaCloudAgentCoverage account/key): no row;
   - not set up: Warning '{{agent}} isn't set up for Orca Cloud yet.' / 'Set it up once in Settings ->
     Agent accounts. Every cloud workspace uses it.'; expired: renew copy;
   - kill switch / not offered: per-workspace wording matching the build-sheet row, never 'isn't set up';
   - not read yet: no row; API-key agents (Gemini, Cursor, Copilot, OpenCode): Cloud secrets copy.
   Non-cloud recipe VMs keep the host copy. cloud-agent-check-copy.ts + unit tests.
2. DS-33: the 7 NewWorkspaceComposerProjectSection:orcaCloudSelected* fixtures (pre-#273 dropdown,
   page error from the unmocked agent-accounts bridge) are removed. Entitled and after-checkout are
   covered by run-on/CloudStart (eReturning, t1); the billing-blocked states move to the segmented
   control as run-on/CloudStartBilling:{noPlanOwner,noPlanMember,outOfHoursMember,spendCapMember,
   paymentIssueAdmin}. The cloud check fixtures seed the account state (no bridge calls); new
   VmBuildSheet:cloudChecksAgentCovered. All 93 new-workspace fixtures shoot with no page errors.
2026-11-10 11:56:39 -08:00
Neil d6cfb6bee0 feat(cloud): DS-40 Fix with agent for failed Orca Cloud environment builds (#301)
* feat(cloud): DS-40 Fix with agent for failed Orca Cloud environment builds

A failed environment build (Settings > Orca Cloud > Cloud environments) now offers, to admins on the
latest build, Try again next to Show error, plus Fix with agent when the install script is what failed.
Fix with agent opens the composer on Orca Cloud with the prompt prefilled ('The environment build
failed at {{step}}. Fix the install script so the build succeeds.'), the current install script and the
log lines already visible in the viewer (redacted, 60 lines / 6 KB, fences neutralized). The new cloud
workspace boots from the environment's last good build, or a blank sandbox if none succeeded, as every
new cloud workspace does. orca cloud env only works on the desktop, so the agent hands back the full
fixed script for an admin to save and rebuild.

Install scripts only run in environment builds (never during a workspace create), so this lives on
the environment panel's failure summary rather than the create sheet.

* fix(cloud): DS-40 design follow-ups: two actions, and clone failures

(a) The failed-build summary drops Show error: the failed step already opens on its error, and the
    summary title now jumps back to it (log scrolled, collapsed or virtualized). Actions are Try again
    (outline) and Fix with agent (ghost). The unused cloudEnvironment.log.showError key is pruned.
(b) Clone failures: from the visible log, repo-content failures (submodules, LFS, paths that can't be
    checked out) offer Fix with agent with 'The environment build failed while cloning {{repo}}. Fix
    the repository setup so the clone succeeds.' (no install script attached; the agent fixes the repo
    on a branch and opens a PR). Access and auth failures offer Give access (GitHub install for that
    repo), never an agent. Anything unrecognized, or a clone log that isn't loaded, offers neither.
    New fixtures panelCloneFailedContent / panelCloneFailedAccess; classifier and helper unit tests;
    fixture spec 3/3.
2026-11-10 11:47:23 -08:00
Neil 8a64916c63 Merge branch 'cloud/integration' of https://github.com/nwparker/orca-private into cloud/w2-runon-row-a11y 2026-11-10 11:24:58 -08:00
Neil 44fef72fd8 fix(a11y): Run on rows say what Enter does (set location, connect, sign in, plan, overage, payment); Enter on a Connect row connects (DS-22 follow-up) 2026-11-10 11:22:57 -08:00
Neil 741fa762fa Merge pull request #298 from nwparker/cloud/agents-wsl-account
feat(cloud): WSL selected-account line; classic SSH hasLogin (API key overrides sign-in)
2026-11-10 11:21:47 -08:00
Neil 29c07ce521 fix(cloud): DS-22 composer a11y — shared focus ring, no open on Tab, no buttons inside Run on options (#299)
* fix(cloud): DS-22 composer a11y: shared focus ring, no open on Tab focus, no buttons inside Run on options

- Project, parent, Run on, name, advanced fields and the create-multiple switch draw focus with the
  shared --focus-ring token (input.tsx / button.tsx patterns) instead of ring-ring/50.
- Project and Run on comboboxes no longer open on focus; they open on typing, ArrowDown,
  Alt+ArrowDown or click. Fixtures and unit tests open them by click.
- Run on needs-setup rows: Connect and Set project location are button-styled spans (pointer only,
  as before), so no option nests an interactive control (axe nested-interactive). The unused
  setLocationOnHost key is pruned from the catalogs.
- tests/component-fixtures/new-workspace-composer-a11y.spec.ts: tab-walk, focus-ring token,
  open keys and a nested-interactive check over the open lists, light and dark (repo has no axe).

* fix(cloud): DS-22: the parent worktree trigger is a combobox field shell, not a restyled <Button>
2026-11-10 11:20:23 -08:00
Neil 0e10276867 fix(cloud): 'API key overrides sign-in' says who pays and how to use the sign-in (panel line, S3 chip tooltip) 2026-11-10 11:05:26 -08:00
Neil 9b78cc13f6 feat(cloud): WSL rows name the selected account; classic SSH reports an API key overriding a sign-in (hasLogin)
- A16 panel WSL rows: 'Account: {{name}} (selected in Accounts)', read from this computer's
  settings (the selection the desktop pushes to the distro), so a stopped distro is never started.
- Classic SSH probe (private): hasLogin when an API key signs the agent in, from presence-only
  checks on the host (Claude: credentials file or macOS Keychain item existence, no -w/-g;
  Codex: grep -q for a refresh_token key). Each prints only yes/no; no value is read or returned.
  S3 shows 'API key overrides sign-in' (needs attention, Review); the panel row says the same.
2026-11-10 11:01:28 -08:00
Neil a1dbf3350f test(cloud): SSH status queues one forced follow-up and never reuses a report across a reconnect 2026-11-10 10:51:55 -08:00
Neil d8a2aa03f9 fix(cloud): harden classic SSH sign-in (security review LOWs)
- LOW-1: login output is read as complete, capped lines (4 KB) with bounded link tokens; Codex's
  prompt is parsed over the last 12 lines; a host that prints 256 KB without a sign-in link fails
  the flow. No quadratic rescans of a hostile stream.
- LOW-2: Claude's link is pinned to Claude Code's own OAuth app (client_id
  9d1c250a-e61b-44d9-88ed-5944d1962f5e) and paste-code callback (https://platform.claude.com/oauth/
  code/callback), both read from the CLI (2.1.318-2.1.322); the last pinned link on a line wins, so a
  login-shell banner can't supply it. claude-pasted-code-login.ts (touched by #40228) is not edited.
- LOW-3: status checks are keyed by target and connection generation (no report reused across a
  reconnect); a forced ask while one runs queues one follow-up instead of opening more sessions.
- A connection dropped after the code is sent reports disconnected, not rejected.
2026-11-10 10:49:59 -08:00
Neil 228ef8f80d fix(cloud): SSH sign-in nits — paste placeholder, 'use its shell profile', link-styled Agent API keys (design-squad) 2026-11-10 10:41:52 -08:00
Neil 36acde0023 feat(cloud): classic SSH agent sign-in status and code sign-in over remote exec
Spec v4 §4 annotations 4-5, Q8. Main runs the CLIs' own status commands (claude auth status --json,
codex login status) over the host's SSH exec only while it is connected, 60 s cache per target;
only verdicts reach the renderer. Code sign-in runs Claude's paste-code login and Codex's device
code over SSH exec (no callback, no forward): the pasted code goes to the CLI's stdin, never argv;
codes, tokens and CLI output are never logged. The A16 panel's classic-SSH rows get Sign in (inline
paste / device code), Sign out, the dated last report and the spec's disabled reason while
disconnected; S3 checks classic SSH hosts the same way. No #40228 file edited.
2026-11-10 10:37:31 -08:00
Neil f0a741053c fix(cloud): strip device code uses one 'Copy code and open' (⋯: Paste a code instead, Cancel); queued chip reads 'Queued:' (design-squad) 2026-11-10 10:23:54 -08:00
Neil 07defc13fc feat(cloud): sign-in strip on Orca Cloud panes — account recovery (S4-c) and the per-workspace fallback (NP-2, option c)
Private layer only; no #40228 file changes (its exports are read, not edited).
- cloud-agent-launch-hold: a cloud Claude/Codex launch decides from the Orca account (cached read,
  never the sandbox). Ready or covered by a key: no hold, no delay. Expired or revoked with no key:
  held on the strip until Renew in S0 fixes it; every held pane starts together.
- cloud-agent-credential-spawn-gate: installed outside #40228's spawn gate from
  deferred-cold-restore-and-snapshot.ts (one line).
- CloudAgentSignInStrip: the 56 px strip (redesign §6) overlaying the pane top while the agent hasn't
  started (no terminal layout change): needExpired with Renew (card 13), and #40228's per-workspace
  sign-in steps on cloud with the kill-switch / never-offered copy. Fixed slots; width class decided
  at mount; region, not a dialog; one polite sentence per state.
- AgentPanePortals: cloud panes with a gate get the strip; SSH, WSL and paired hosts keep #40228's card.
Playwright AC-1: every strip state keeps identical boxes (wide and narrow sets).
2026-11-10 10:17:45 -08:00
Neil 37a3a6efe6 fix(cloud): S3 pins This computer then Orca Cloud; HostGlyph per row instead of the lock (design-squad) 2026-11-10 10:04:59 -08:00
Neil 8a6a13b93a test(cloud): S3 probe concurrency test waits on microtasks, not the clock 2026-11-10 10:01:59 -08:00
Neil 4c8729f15b feat(cloud): S3 Settings › Agent accounts overview — sign-ins by host
Spec v4 §7: a real table under S0, hosts as rows, Claude and Codex as columns, with the §7 cell
vocabulary. Orca Cloud is one row ('all your cloud workspaces'): Your Orca account or the winning
key per agent; the kill switch and a never-offered provider change only its cells. Rows open the
A16 panel (click or Enter; Review focuses that agent's row); Check again re-asks one host; the
Orca Cloud row opens S0. All · Needs attention filter, attention rows first, expired derived from
the last cached verdict, one polite summary after the first pass. Probes: awake, connected hosts
only, at most four at once, each from its own 60 s cache, no polling; stopped, suspended,
disconnected and unreachable hosts are never asked (tests assert it).
2026-11-10 10:00:07 -08:00
Neil a4276afe99 fix(cloud): Cloud Agents section intro is source-neutral (design-squad P3) 2026-11-10 09:49:30 -08:00
Neil c5954f3e9f fix(cloud): paired-host environment line reads 'use its own environment' (design-squad nit) 2026-11-10 09:48:31 -08:00
Neil 27c702dbbc feat(cloud): A16 panel on hosts with their own login (part 2)
Section 1 for this computer, SSH with an Orca server, WSL, recipe VMs and paired hosts: each agent's
verdict from accounts.agentSignInStatus (cached report first, asked once per open and only while the
host can answer; stopped, suspended, disconnected and unreachable hosts are never started, resumed or
connected), 'Sign out…' moved here from the host ⋯ menu (HostAgentSignOutDialog stacks above the
sheet), disabled with its reason via aria-disabled + tooltip. Classic SSH says it can't check yet.
Section 2: this computer's Agent API keys that apply to the host. Section 3: the spec's one line, or
the recipe env-forwarding warning. The host ⋯ menu's single 'Agent accounts & secrets…' now shows for
every remote host. Fixtures for all kinds; tests assert no host call while it can't answer.
2026-11-10 09:45:17 -08:00
Neil e6ba05e559 Merge remote-tracking branch 'private/cloud/integration' into cloud/agents-host-panel 2026-11-10 09:38:42 -08:00
Neil f57eecb109 fix(cloud): A16 design-squad fixes: shared workspaces show what applies (D13), no section numbers, first focus on the labelled header, glossary state labels, NP-3 status-panel wording 2026-11-10 09:38:39 -08:00
Neil 7aa33d7ae6 fix(cloud): A16 panel passes premerge lint (host facts from the caller, sanctioned record reads, no primitive restyles) 2026-11-10 09:29:21 -08:00
Neil 1c726d82a8 feat(cloud): A16 Agent accounts & secrets panel, Orca Cloud first
The per-host panel (spec v4 §4) as one right-side sheet: header (title, dot, host · kind · state),
three sections and footer links, driven by hostCapabilities(kind, availability) for all seven kinds
(exact hidden/disabled/help copy). Orca Cloud renders now:
- Section 1 'Agents' from the Orca account (no probe): From your Orca account / winning key, the
  lock line, the two-way Source per workspace (setWorkspaceSource), disabled with its reason via
  aria-disabled + tooltip when shared, archived or unreadable; kill switch and never-offered rows.
- Sections 2-3: W6's CloudAgentKeysSection / CloudEnvironmentPanelSection (numbered 2, 3) with the
  A6 'Save to your Orca account' offer as extra key rows.
Entry points: openAgentHostPanel({hostId, focus}); the host ⋯ menu's one 'Agent accounts &
secrets…' on Cloud hosts (replacing the sign-out group there), and 'Agents and secrets · summary'
in the Cloud workspace status panel. A test asserts opening it never wakes, starts, resumes or
connects anything. Also design-squad's nit: 'This sign-in stays with this workspace.'
2026-11-10 09:24:17 -08:00
Neil fbae7424ad Merge pull request #291 from nwparker/cloud/w2-fixture-ok
test(cloud): CloudStart fixtures without page errors
2026-11-10 09:12:37 -08:00
Neil 4b014c4b83 test(cloud): CloudStart fixtures run without the agent-accounts bridge (no page errors) 2026-11-10 09:11:06 -08:00
Neil e4834532bc Merge pull request #289 from nwparker/cloud/agents-provider-state
fix(cloud): tell 'provider never offered' (flag off) from the kill switch
2026-11-10 09:10:58 -08:00
Neil a46b65194d fix(cloud): flag-off agents sign in for this workspace in the build sheet; one muted line when both are off
The NP-3 Agents row reads a never-offered provider as its sign-in-here state (reason notOffered:
'Signs in for each cloud workspace for now', never 'paused', never Set up). Settings collapses the
Orca Cloud section to 'Claude and Codex sign in for each cloud workspace for now.' when neither
provider is offered (design-squad).
2026-11-10 09:09:12 -08:00
Neil c469fbcb25 Merge remote-tracking branch 'private/cloud/integration' into cloud/w2-signed-out-cloud 2026-11-10 09:07:25 -08:00
Neil e375e87621 fix(cloud): folder row actions as outline + link buttons; link buttons underline on focus; folder-like fixture project 2026-11-10 09:07:23 -08:00
Neil 7f48521f1b Merge remote-tracking branch 'private/cloud/integration' into cloud/agents-provider-state
# Conflicts:
#	src/renderer/src/i18n/locales/en.json
2026-11-10 09:04:59 -08:00
Neil 5b69b88166 Merge remote-tracking branch 'private/cloud/integration' into cloud/w2-signed-out-cloud 2026-11-10 09:02:16 -08:00
Neil 1955af1e2c feat(cloud): folders can pick Orca Cloud; the panel offers a GitHub repository instead (D3 for folders, design-squad) 2026-11-10 09:02:13 -08:00
Neil 5883d7eaf6 fix(cloud): tell a provider that was never offered (flag off) from the kill switch
GET /v1/agent-credentials adds providerState {claude, codex: on|off|disabled} next to providerEnabled.
Clients read it through orcaCloudProviderState (older servers: disabled = kill switch; a state that
contradicts providerEnabled is never trusted). Flag off is a new 'unavailable' kind: Settings says
it isn't available in Orca Cloud yet (no 'right now / until it's back'), and the composer hides the
Agent row like an agent without an account path. Kill-switch copy is unchanged.
2026-11-10 09:02:08 -08:00
Neil 54fcf0ee48 Merge remote-tracking branch 'private/cloud/integration' into cloud/agents-buildsheet-row 2026-11-10 08:53:20 -08:00
Neil aaa1921094 fix(cloud): NP-3 design-squad wording: one '·' between source groups ('Claude from your Orca account · Codex with the team key'); full text in title for truncated lines 2026-11-10 08:53:17 -08:00
Neil 8e5ce5d0f1 Merge pull request #288 from nwparker/cloud/agents-badge-wrap
fix(cloud): secret names never truncate; chips sit under the name (design-squad P2)
2026-11-10 08:51:54 -08:00
Neil 5c09e047d1 fix(cloud): NP-3 row: R2 setup queue lives in the accounts store (no state set in effects); kill-switch sign-in is per request; UI-locale list format; drop the removed build step's catalog keys 2026-11-10 08:49:14 -08:00
Neil 604bbf75fb fix(cloud): signed-out and not-yet-entitled users can pick Orca Cloud and reach Set up and start 2026-11-10 08:48:26 -08:00
Neil 1ebdef8df6 feat(cloud): NP-3 build-sheet Agents row (spec v4 §5b): fixed height at mount, zero layout shift
- One row from the Orca account, never the sandbox: 32 px ready line when every agent is ready at
  mount, otherwise 48 px; every later state renders inside that height (Playwright: measured layout
  shift 0, logs toggle never moves).
- R2 Set up runs S0's setup inline for each agent in turn; device code, browser, paste, failed,
  expired, kill switch (per-workspace sign-in, queued until the sandbox answers), A6 desktop key.
- ⋯ menu: Source per agent in this workspace (new per-workspace setWorkspaceSource / workspaceSources
  IPC; main resolves the sandbox id from its own runtime records), Manage agent accounts.
- Removes the v3 'Add an agent' build step and the per-sandbox Cloud sign-in row from the sheet.
2026-11-10 08:45:38 -08:00