[codex] add Web AI account workspaces
Summary
Orca already had persistent browser session profiles, but it did not have an account-level workspace model for hosted AI web apps. Switching a tab to another profile rebuilds its webview, account tabs were mixed into project navigation, and cookie import followed the focused runtime rather than the hosted account's owner.
This PR adds a desktop-only Web AI Accounts sidebar section where each saved identity owns an isolated, persistent browser workspace:
- supports ChatGPT, Claude, DeepSeek, Gemini, Google AI Studio, and validated Custom HTTPS services such as Doubao
- keeps each account on one stable browser profile and
persist:partition, with multiple tabs sharing only that account's identity - uses
Cmd+1..9for account/project workspaces,Ctrl+1..9for tabs inside the active account on macOS, andCmd+Tfor a new tab in the same account - preserves the existing collision-free Windows/Linux bindings:
Ctrl+1..9for workspaces andAlt+1..9for tabs - persists accounts, collapse state, URLs, tab/group topology, active selection, profile IDs, and partitions across restart
- limits Chrome/file cookie import to the selected fixed or Custom provider, preserves unrelated target cookies, and rolls back partial writes
The implementation uses stable session isolation rather than rotating fingerprints. Web AI workspaces remain local to Electron and are excluded from paired runtime/mobile publication.
Screenshots
Provider choices, including Google AI Studio and Custom:

Validated Custom provider setup with an automatically derived Doubao cookie scope:

Testing
- [x]
pnpm lint - [x]
pnpm typecheck - [x]
pnpm test(the identical feature patch passed the full suite with2,881files passed,6skipped;30,528tests passed,45skipped) - [x]
pnpm build - [x] Added or updated high-quality tests that would catch regressions, including account isolation, shortcut routing, restart hydration, legacy migration, scoped cookie replacement/rollback, Custom domain validation, local/remote owner routing, stale async response rejection, and paired-client privacy filtering
After rebasing, a latest-base full-suite run passed 30,526 tests and hit four timeout-only failures in unrelated SSH/sidebar/GitHub-refresh files while another full suite was running in the original worktree. All four failed files plus the source of the run's unhandled timer rejection then passed together (5 files, 86 tests). The overlapping upstream markup tests and the final upstream sidebar tests also passed (45 tests). git range-diff confirms that both rebases preserved the feature patch exactly.
Final checks used Node 24.18.0; the branch is based on origin/main at 24dc165b3.
AI Review Report
The AI review explicitly checked macOS, Windows, and Linux shortcut behavior and labels; local, SSH, and runtime ownership; CLI agents, integrations, and git-provider isolation; Electron webview lifecycle; performance; UI quality; and basic security.
The review initially flagged that local Web AI cookie import could follow a focused remote runtime, Web AI URL/title metadata could enter paired mobile snapshots, stale profile bindings could survive account navigation, and out-of-order browser detection could mix source lists across hosts. Those paths were fixed and regression-tested: Web AI profile operations are pinned to the local owner, host caches use owner/generation guards, synthetic workspaces are filtered before serialization, and sidebar/number/new-tab launches revalidate the canonical profile and partition before creating a guest.
No new git, shell, file-path, CLI-agent credential, or provider integration behavior is introduced. Ordinary project browsers and remote runtime browsers retain their existing routing. Warmed webviews improve switching latency but memory/process use still scales with the number of open account tabs; no one-second post-restart guarantee or LRU policy is claimed.
The UI uses existing Orca tokens, shadcn primitives, and Lucide icons. The add-account flow and provider list were verified in Electron at a 1566x1086 renderer size without overflow or clipping.
Security Audit
Custom services require HTTPS and reject credentials in URLs, IP hosts, wildcards, public/private suffixes, unrelated cookie domains, and malformed scopes. Query strings and fragments are removed before persistence. Fixed and Custom cookie scopes are validated again across renderer, preload, IPC, RPC, and main-process boundaries.
Scoped cookie import prepares/decrypts all selected source cookies before mutation, filters expired cookies, preserves unrelated target cookies and Google integrity cookies, and snapshots the target scope for rollback if any removal or write fails. Results expose counts/domains rather than cookie values.
Web AI profile operations remain on the local Electron host even when a remote runtime is focused. Web AI synthetic workspaces are excluded before runtime/mobile snapshot serialization, so account IDs, page titles, and full URLs are not published to paired clients. Electron's existing will-attach-webview partition allowlist remains the final enforcement boundary for deleted profiles.
The final diff and commit metadata were scanned for personal absolute paths, non-noreply email addresses, tokens, API keys, secrets, real cookie values, account/profile identifiers, screenshots, and generated artifacts. No sensitive or unrelated material was found; credential-shaped URLs appear only in synthetic rejection tests.
Notes
- Web AI accounts are desktop Electron surfaces and are intentionally not rendered by the paired web client.
- Restart restores account and tab topology, but Chromium guest processes must reload after the app exits.
- Fresh OAuth, SSO, MFA, passkey, Cloudflare, and Google login behavior remains site/policy dependent; scoped import from an existing Chrome profile is available as a fallback.
- This does not implement rotating fingerprints, anti-detect behavior, per-account proxies, or account-limit evasion.
terminal-firstshortcut policy can still allow the focused terminal application to own number chords.- X handle: @ansonlotiniat