Composer: an older chat's Computer menu reads the Cloud account (follow-up to #27973)

Merged
TE
6d ago
+40-9

Follow-up to #27973, which merged as 43b8e858. This PR now holds only what that merge left out.

Already on base, dropped from this PR

  • Sign in for Cloud runs its own cloudSignIn kind, mapped to palette.auth.signIn (environments.ts CONNECT_ACTIONS, AgentPaneModel.connectActions), so it never creates a machine. The Swift test cloudSignInRunsSignInOnAGesture is on base too.
  • The row in both the plain Computer menu and the environment picker, with its strings, the chat_state capture state and the debug cloudSignedIn field.
  • Unknown account state still offers the row, and a refused read clears the list and the account state. #27973 settled both of these (fresh home: "EnvironmentPicker treats only an explicit true as signed in"; native.not_connected keeps the list), and base's tests assert them. This carry had reversed both. The merge takes base's design, so it is not quietly undone.

What remains

  • An older chat's menu reads the Cloud account as it opens. Base reads cloudMachine.list only for a new chat. A started chat's plain Computer menu still has connect rows, so it never learned the account state and kept offering Sign in for Cloud to someone already signed in. A menu with connect rows now reads it too (ComposerContext.tsx, readsCloudAccount), so the row goes away once the app says signed in. It uses the menu's existing open/refresh callback; no new timer.
  • Gallery seam cloudSignedIn on ComposerContext (the app's state when omitted), and the state agent-pane.composer-context#computer-first-setup-signed-in (no sign-in row).

Tests

  • webviews/test/environment-picker-cloud-machines.test.tsx: "an older chat's plain picker reads the Cloud account as it opens, so a signed-in person gets no sign-in row". Red on base's ComposerContext.tsx (1 fail), green here.
  • environment-picker-cloud-machines.test.tsx and environment-picker.test.tsx: 82 pass, 0 fail. bun run strings and bun run check (CMUX_LOCAL_HEAVY_CHECKS=0) pass.
  • No Swift changes remain.

Risk

Small. One more cloudMachine.list post when a started chat's Computer menu opens. The app serves it from its store.

Changelog

Fixed: an existing chat's Computer menu stops offering Sign in for Cloud once you are signed in.

Agent session: agent session

šŸ¤– Generated with Claude Code