PR #10045 review: one accounts flow for agents
Summary
The PR merges the three places that held agent accounts into one. Settings › Agents (now under Personal) and Usage share one AgentAccounts list for Claude and Codex. Each local account gets a "Sync to cloud" button or a ☁ Cloud chip, and Settings › Cloud › Agents is removed. The new-workspace screen now asks to set up a cloud sign-in before it creates a cloud workspace with an agent that has none. Most of the 104 files are moves (CloudAuthDialog, useAgentCredential, the Usage account parts).
Verdict
Needs changes
Removing Cloud › Agents leaves no way to set up, see, or disconnect a cloud sign-in unless a local login for that agent exists on this machine. Also, "Sync to cloud" labels an API key or gateway credential with a subscription account's email, so the ☁ Cloud chip can be wrong.
Findings
ImportantThe cloud sign-in can only be reached from a local account card
apps/desktop/src/renderer/routes/_authenticated/settings/components/AgentAccounts/AgentAccounts.tsx:171-192. openCloudDialog is only called from cloudFooter(account), which only renders on an account card. With zero local logins the section shows "No Claude Code logins on this host" and has no cloud entry point. See screenshot 2: this is the real state of this cloud workspace.
Who is affected:
- People who use only cloud workspaces.
- Machines where the host service is down (
hostUrlnull). - Anyone whose cloud credential is an API key, Vercel AI Gateway or Manual. That credential never matches a card, so Settings never shows it, and the only way to disconnect it is through some unrelated card's "Sync to cloud".
The old Cloud › Agents page had a per-agent Set up / status row; this PR deletes it (settings/agent-accounts/page.tsx now redirects). The chat's "open agent settings" fallback (useAgentSignIn.ts:24-31) now lands on this page too. Because "Not now" is permanent (finding 3), a user who declines once and has no local login is left with no path at all.
Fix: in AgentAccounts, when cloudEnabled, always render one agent-level "Cloud" row above the cards. It shows the stored method and label ("Subscription · a@x.dev", "API key", "Manual", "Not set up") and has a Set up / Manage button that opens CloudAuthDialog with forEmail: null. Keep the per-card chip for the email match.
Important"Sync to cloud" stamps the account email on any credential kind
AgentAccounts.tsx:100-104 and NewWorkspaceScreen.tsx:1086-1092 set accountLabel: input.accountLabel ?? forEmail for every save, including kind: "api_key" and provider: "gateway".
Concrete case:
- Click "Sync to cloud" on the local account
a@x.dev(a Claude Max subscription). - Choose API key and save an
sk-ant-…key. - The row is saved with
accountLabel = "a@x.dev", soisAccountInCloudshows ☁ Cloud ona@x.dev.
Cloud actually bills that API key, not the subscription. The "Subscription ✓ a@x.dev" line in CloudAuthDialog only shows for subscriptions, so the two views disagree.
Fix: add forEmail only when input.kind === "subscription" && !input.provider, or make isAccountInCloud also require state.subscriptionConnected. Add a test case for each.
Minor"Not now" is remembered forever, with no way to undo it
apps/desktop/src/renderer/stores/workspace-create-defaults.ts:165 appends to cloudSignInDeclined, and nothing ever removes the entry. No UI resets it, and a later sign-in followed by a disconnect does not clear it. Together with finding 1, a decline hides the only remaining prompt for good.
Fix: remove the agent from the list when its cloud credential becomes configured (so a later disconnect prompts again), or store a timestamp and ask again after N days.
MinorA failed credential fetch is treated as "not signed in"
NewWorkspaceScreen.tsx:1014 passes credentialsLoaded: !cloudCredential.isLoading. If agentCredential.list errors (API down, auth blip), isLoading is false and data is undefined. The prompt then says "Claude is not signed in for cloud workspaces" to a user who is signed in, and "Set up" offers to replace their credential.
Fix: expose isSuccess from useAgentCredential and pass credentialsLoaded: cloudCredential.isSuccess.
NitThe settings search entry is no longer gated by the cloud flag
apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts:1752-1756. The item moved from agentAccounts (cloud-gated) to agents, which has no gate. Users without CLOUD_WORKSPACES now see "Accounts agents sign in with, on this machine and in cloud". Drop "and in cloud" or pick the description by flag.
NitA doc still lists the removed route as a page
docs/desktop-error-cdp-verification.md:109 lists /settings/agent-accounts as a route that renders. It is now a redirect to /settings/agents.
Checked with no problems found: the persisted store gets a new field inside an already-registered key (v2-workspace-create-defaults), bounded by the 3 cloud agent ids, and the default shallow merge fills it for old profiles. No tRPC procedure changed; agentCredential.set already accepted accountLabel. The moves keep co-location, and imports were updated. The new strings have catalog entries in all 17 locales.
Evidence
Desktop dev app from this branch (c7b4e7a1), renderer at localhost:3005 and CDP on port 9333, against the workspace's local API (localhost:3001), signed in as Local Admin (dev). The CLOUD_WORKSPACES flag is on. Navigation used real clicks over CDP.




AgentAccounts section for Claude Code and Codex, each with Add account. There are no local logins, so no cards and no Sync to cloud buttons.
Not verified
- The CloudSignInPrompt on create, and Set up / Not now: after I switched the device to Cloud, the desktop dev process was killed with exit 137. That is the third kill on this 8 GB box: the stack's own desktop window before I started, then my attempt and my retry. I did not press "Not now", because it would start a real cloud workspace.
- A local account card with Sync to cloud / ☁ Cloud: this sandbox has no local Claude or Codex login. Findings 1 and 2 come from reading the code.
- The
/settings/agent-accountsredirect: hash navigation did not remount the route, so I did not observe it.
Questions for the author
- Was dropping the agent-level cloud status row intended? Where should a cloud-only user (no local login) set up or disconnect Claude/Codex for cloud?
- Should an API key or gateway credential saved through "Sync to cloud" ever count as that account "in cloud"?
- The old page showed pdev as "Connected" through the Paradev account (
SupersetAccountRow, now deleted). Is losing that intended, or should the pdev agent page say it? - How does a user undo "Not now" for an agent?
Test / CI notes
- All GitHub checks pass at
c7b4e7a1: Lint, Typecheck, Test, Sherif, Vale, Build CLI and the deploys. CodeRabbit was still pending. bun testinapps/desktoponsettings/,DashboardNewWorkspaceModal/andstores/: 267 pass, 0 fail (60 files). This includes the newisAccountInCloudandshouldOfferCloudSignIntests.- A local
tsc --noEmitforapps/desktopwas killed for memory (exit 137) in this sandbox. I rely on the green CI Typecheck instead. - No test covers the
accountLabelchoice insaveCloud, which is where finding 2 lives.