feat(desktop): one accounts flow for agents, on this machine and in cloud
Summary
- Settings › Agents replaces "Agent commands" (now under Personal, next to Usage). Settings › Cloud › Agents is removed;
/settings/agent-accountsredirects. - Usage and Agents › Claude/Codex share one
AgentAccountscomponent: add, make default, switch sign-in, remove, and Sync to cloud for an account that is only on this machine (☁ Cloud once synced). - New cloud workspace asks first when the chosen agent has no cloud sign-in, naming the local account it found. "Not now" still creates the workspace and is remembered per agent.
Screenshots from the dev build: https://app.superset.sh/page/agents-settings-dev-build-preview-ux71x8
Why / Context
Agent accounts lived in three places: Usage (this machine), Cloud › Agents (cloud, one per agent, no link to any local account) and Agent commands (launch settings only). People could not tell which local account cloud used, and found out cloud was not signed in only when an agent in a cloud workspace asked them to sign in.
How It Works
settings/components/AgentAccounts/holds the account list, its dialogs, hooks and utils (moved fromsettings/usage/...). Usage renders it for Claude and Codex; the agent detail page renders it for the same agents. Read-only quota agents (Grok, Antigravity, OpenCode) keep their cards on Usage.- Cloud match:
agent_credentialsholds one sign-in per agent with anaccountLabel. A local account shows ☁ Cloud when its email equals that label (isAccountInCloud). Sync to cloud opens the existing cloud sign-in dialog (subscription, API key, Custom provider / Vercel AI Gateway, Manual) and saves with that account's email as the label. A cloud sign-in saved without an email matches no account. CloudAuthDialoganduseAgentCredentialmove toroutes/_authenticated/{components,hooks}because Settings and the new workspace screen both use them.useAgentCredentialgains anenabledoption so it does not query when cloud is off.- New workspace:
handleSubmitchecksshouldOfferCloudSignIn(cloud host, cloud agent, credentials loaded, not signed in, not declined) and opensCloudSignInPrompt. "Set up" opensCloudAuthDialog; when the credential becomes configured the create continues. Declines are stored inworkspace-create-defaults(cloudSignInDeclined, bounded by the cloud agent ids). - Cloud support uses the existing
isCloudAgentId(agents the sandbox image installs). The agent list shows a cloud icon; other agents say "Cloud workspaces don't include X yet." All cloud UI is hidden whenCLOUD_WORKSPACESis off.
Manual QA Checklist
Verified in the desktop dev app (CDP) with two test Claude profiles (no real sign-in):
- Settings menu: Agents under Personal, Cloud › Agents gone
- Usage and Agents › Claude show the same accounts section with Add account, Make default, Sync to cloud
- Make default from Agents: pointer file
state/default-claude-config-dirupdated, toast shown - Gemini shows "Cloud workspaces don't include Gemini yet."; Claude and Codex have the cloud icon
- New cloud workspace with Codex (no cloud sign-in) → Create → prompt → Set up opens the Codex cloud sign-in; closing it creates nothing
- Sync to cloud opens the Claude cloud sign-in dialog
- Not verified: a real sync that ends with the ☁ Cloud chip (needs a real Claude/Codex sign-in)
- Not verified: "Not now" path (would start a real cloud workspace) and create continuing after a real sign-in
- Not verified in the UI:
/settings/agent-accountsredirect (same pattern as/settings/links)
Testing
bunx tsc --noEmit(apps/desktop): 0 errorsbunx biome checkon changed filesbun test(apps/desktop): 9115 pass before the final move; after the move, settings + new workspace + stores (267) and ChatSession (569) suites passbun run check:i18n: new strings translated in all 17 locales- New unit tests:
isAccountInCloud,shouldOfferCloudSignIn
Known Limitations
- Cloud still holds one sign-in per agent. Syncing a second account replaces the first. Many cloud accounts with one default needs an
agent_credentialsmigration (follow-up). - Sync for Claude still uses the existing token paste (
claude setup-token); reading the token automatically is a follow-up and needs a test with a real account. - Conflicts with #9979 (it edits
AddAccountDialog.tsx, which moves here); the second to merge needs a rebase. - For Claude the token cannot read the profile, so the saved label is the account the user picked, not one Paradev confirmed.
Follow-ups
agent_credentials: many accounts per agent +is_default, so Make default sets this machine and cloud together.- Run
claude setup-tokenfor the user and read the token.
Summary by cubic
Unifies agent account management across local and cloud so the same accounts list works on this machine and in cloud workspaces.
- Settings › Agents (under Personal) replaces "Agent commands"; the old Cloud › Agents section is removed and its route redirects.
- Usage and the Claude/Codex agent pages share one
AgentAccountscomponent, which now shows a ☁ Cloud chip when a local account is also signed in for cloud, and a "Sync to cloud" action to set that up. - Creating a cloud workspace with an agent that has no cloud sign-in asks first, naming the local account it found; "Not now" creates the workspace anyway and is remembered per agent.
Note: cloud still holds one sign-in per agent, so syncing a second account replaces the first. Follow-up work will allow many accounts per agent.
Summary by CodeRabbit
- New Features
- New cloud workspaces can prompt you to sign in to an eligible agent. You can set it up immediately or choose “Not now” and continue creating the workspace.
- Agent settings now bring account management together, with options to add accounts, choose a default, switch sign-ins, remove accounts, and refresh usage.
- Agent settings identify cloud-compatible agents and indicate when an agent isn’t available for cloud workspaces.
- Updates
- Agent account settings now open from the Agents section; the previous account-settings route redirects there.