Repository navigation
feat(cloud): set up environments from chat, per-environment machine size, environment page in Settings - #9707
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
|
Review: minor issues. The design is sound, the API changes are additive, and every surface I could reach worked at
Verified in the desktop dev build: chip, retry on the same environment, picker repositories and Edit item, environment page in Settings, machine size save/reset/"not on your plan", API refusing an unoffered size, old-route redirect at boot, sidebar Manage environment, and the dialog's Start agent failure path. Not reachable here: the "…" menu / Save checkpoint and the in-chat chip, because cloud workspaces stay on "Starting". Tests (108 trpc + 44 desktop), Full report with screenshots: https://app.superset.sh/page/pr-9707-review-cloud-environment-onboarding-y0foyd |
…ize, environment page in Settings Cloud onboarding (SUPER-3149) - New-workspace screen: when the selected project has no cloud environment, a "Set up Environment" chip creates a personal environment from the project's repository and starts a cloud workspace whose agent sets it up. Send in that state does the same with the typed message plus a sentence that loads the superset:environment skill inside the box. - Create environment dialog: "Start agent" now starts that setup in a cloud workspace instead of a local chat; adds "Skip & save" and an explanatory note. Links the project only when the environment opens on its repository. - In a cloud chat whose environment has no checkpoint yet, a chip inserts the setup request into the composer. Environments carry a machine size (SUPER-3135) - environment.create/update accept an optional machineSize (null resets to the organization default); cloudWorkspace.create boots at the environment's size when the caller names none, falling back to the org default when the plan no longer offers it. Automations without their own size and moves to cloud now use it; the size pickers on the new-workspace screen and the Move to cloud dialog are removed. Environment UI (SUPER-2747) - The environment page moves into Settings (/settings/environments/<id>); the old route redirects. Rows open it, and it now carries the variables editor that used to be a separate screen. - Environment picker shows each environment's repositories and "Edit". - Cloud workspace "…" menu: Manage environment, Save checkpoint. Sidebar right-click: Manage environment (looked up only when the menu opens).
- Setup runs with the selected agent, or the default cloud agent when none is selected; the Create environment dialog uses the same default instead of always Claude. With no agent available it says so instead of starting a bare workspace. - The retry-on-the-same-environment decision is a pure, tested util and no longer waits for the environment list to catch up; it is scoped to the project it was made for. - Cloud submit waits only while projects load, so an unresolvable remembered project can't hold it on "Loading environments…". - The Send → dialog fallback keeps the draft instead of clearing it. - The "Set up Environment" chips (new workspace and in chat) send the setup request plus the superset:environment line for the environment. - The in-chat chip shows only to the environment's creator, and reuses useWorkspaceEnvironment. - Changing a shared environment's machine size needs its creator or an org admin/owner, since it sets the bill for everyone who boots on it. - The remembered per-project machine size is gone from resolveCloudChoices and the create-defaults store (v4 migration drops it from saved data). - Tests: environment.update size permission, null reset and validation.
- Send through the Create environment dialog clears the draft once the agent starts, and the dialog starts the agent the user picked. - Saving a checkpoint onto a shared environment needs its creator or an org admin, the same rule as changing its size; the menu hides it for others. - Save checkpoint refreshes the workspace list as well as environments. - A refused environment create on the new-workspace screen offers billing. - The automation size picker can go back to the environment's size. - CLI and MCP help no longer call medium the default size. - Translate the .env upload error; move ManageEnvironmentItem next to its user; drop comments that restate the code.
c8609a3 to
ed9c0e8
Compare
|
Preview update published for development build |
Conflicts were in the move UI, which main changed for per-environment machine size (#9707) and machine size menus (#9709): - MoveWorkspaceToCloudDialog: main edited it, this PR deletes it. The deletion stands. Main's change (machine size picker removed, CreateEnvironmentFlow props) only affected the dialog. - DashboardSidebarWorkspaceContextMenu, WorkspaceMoreMenu: took main's versions (environment item, machine size menu, save checkpoint) and reapplied the shared WorkspaceMoveMenu in place of the flat move items and dialog state. - useStartWorkspaceMove: a cloud move no longer takes a machine size on main, so the remembered-size lookup is removed.
Links
environments.machine_sizemigration). Merge that first; this PR retargets tomainafter.Summary
This PR bundles three related pieces of cloud-environment work:
Part 1: Set up an environment from chat (SUPER-3149)
Why
A new user who picks Cloud for a project with no environment gets stuck. "Environment" reads like Cloud vs Local, and nothing guides them to create one.
What / How
superset:environmentline for that environment. It ignores the draft's text, linked issues and attachments, and keeps the draft.superset:environmentinside the box ("you are already in a box on that environment, so set it up here").planEnvironmentSetup, unit-tested).projectToLink).sourceKind: "image"), the environment's creator sees a chip that inserts the setup request plus thesuperset:environmentline into the composer.Key decisions
superset:environmentis written for driving a box from outside.Part 2: Environments carry a machine size (SUPER-3135)
What / How
environment.createtakes an optionalmachineSize.environment.updatetakesmachineSizethat may benull, which resets to the org default.cloudWorkspace.create:verifyOrgAdmin).launchTasknever passed a size, so Dev workspaces also boot at the environment's size once one is set.#mention menu) and the Move to cloud dialog.MachineSizePickerPillis deleted.Compatibility (trpc-compat)
machineSizeoncloudWorkspace.createnow means "the environment's size, else the org default". Every existing environment row isnull, so nothing changes until someone sets a size. The input JSDoc and the SDK type docs are updated to match.environment.promoteonto a shared environment now returns FORBIDDEN ("Admin access required", an error clients already show) to a member who neither created nor administers it. This is a deliberate tightening.mediumthe default size.update.machineSizefield, so the desktop setting quietly does nothing there. The API deploys on merge, well before a desktop release.Part 3: Environment page in Settings (SUPER-2747 and follow-ups)
/settings/environments/$environmentId./environments/$environmentIdroute is now abeforeLoadredirect, because the app restores its last route at boot.…menu:environment.promotewith the workspace'senvironmentId. It's disabled until the workspace is ready and while a save is in flight, and it refreshes environments and the workspace list afterwards.environment.promoteonto a shared (organization) environment now needs its creator or an org admin/owner, the same rule as its size. Before, any member who could see it could replace the checkpoint everyone boots from. The menu hides the item for everyone else. A personal environment is unaffected.formatDate, andCreateEnvironmentFlow,EnvironmentViewandsettings/environmentsare added to the i18n enforced dirs.Manual QA Checklist
Done in the desktop dev build against the local API, with real mouse and keyboard input (xdotool) and request bodies captured over CDP:
cloudWorkspace.createprompt is exactly the setup request. Send → typed message + thesuperset:environmentsentence with the new environment's URL.claude, nomachineSize, and the setup prompt. Skip & save creates the environment, closes the dialog, and sends no workspace create.large, choosing the default savesnull(read back throughenvironment.get)./environments/<id>URL on reload lands on/settings/environments/<id>.Not verified end to end:
…menu items: cloud workspaces never get past "Starting" in this sandbox.Testing
tsc --noEmitinapps/desktop,packages/trpc,packages/sdk,packages/dbbunx biome check(clean)bun test apps/desktop/src/renderer/{routes/_authenticated,stores,lib/persisted-keys}: 9610 pass (whole desktop suite)bun test packages/trpc/src/router: 655 pass.packages/cli: 513 pass,packages/mcp: 26 pass, andtscin both. New: boots at the environment's size; falls back when the plan stopped offering it (asserts the second lookup); refuses an explicit unoffered size;environment.updaterefuses a non-creator, non-admin on a shared environment, resets withnull, and refuses an unoffered size;environment.promoterefuses a non-creator, non-admin replacing a shared environment's checkpoint (fails without the check).planEnvironmentSetuptests: retry before and after the list catches up, a different selected environment, another project, and the dialog fallback.bun test packages/i18n: 172 pass (including the three newly enforced dirs)bun run check:i18n: all 17 locales fully translatedKnown limitations
cloudDispatch.Deployment / Rollout
Summary by cubic
Bundles three related pieces of cloud-environment work: setting up an environment from chat, per-environment machine size, and moving the environment page into Settings. Stacks on the
environments.machine_sizemigration and must merge after it; API changes are additive, and released desktop builds keep sending their own size until updated.Set up environments from chat
Machine size and environment page
/settings/environments/<id>(the old route redirects) and hosts the variables editor, size selector, and Manage environment / Save checkpoint entry points; Manage environment also shows in the cloud workspace's…menu and sidebar right-click.Written for commit ed9c0e8. Summary will update on new commits.