PR #9638 review: cloud --effort and --tag
Summary
For cloud workspaces, --tag was refused by the CLI and cloudWorkspace.create had no tags input, and --effort was dropped when the first agent opens as an ACP chat. The PR adds an optional tags input to cloudWorkspace.create (passed to startCloudWorkspace, which already stores them), lets the CLI send --tag for cloud, and threads effort through host-service's chat launch (createChatSessionSchema → effortId), removing the old "effort ⇒ no chat" refusal in chatLaunchTarget.
Verdict
Minor issues. The approach is correct and small, each new test fails on the base and passes on the head; the only real gap is the CLI reference still saying --tag is rejected for cloud.
Findings
- Stale docs:
apps/docs/content/docs/cli/cli-reference.mdx:835still lists--tagamong the flags "rejected for a cloud workspace". After this PR that is false. Fix: drop--tagfrom that list (and optionally say tags file the cloud workspace into a sidebar folder). - Effort is not validated on the chat path (low, design note):
packages/host-service/src/trpc/router/agents/agents.ts:665validatesmodelandmodebut noteffort, sosessions.create/ a cloud first boot with--effort bogussilently runs at the agent default, while the terminal path (validateAgentEffortSelection,agents.ts:206) throws. The PR calls this out as intentional for the cloud first boot. Fix (optional): validate insessions.createonly when the caller is interactive, or at least log the skipped effort so a user can find out why it did not apply. - Test couples to
startCloudWorkspaceinternals (nit):packages/trpc/src/router/cloud-workspace/cloud-workspace.test.ts:93-98stubsenvironmentRepositoryRows,primaryRepository,recordWorkspaceRepositories,workspaceBranchNameand a genericdb.insert. Any refactor ofstart.tswill break these tests without a behaviour change. Acceptable for now; consider a test that callsstartCloudWorkspace's tag step directly if this grows.
Checked and fine: the returned tags: input.tags ?? [] (cloud-workspace.ts:525) is already normalized because workspaceTagsInputSchema transforms (trim, lowercase, dedupe, sort). The claim "no released client sends chat + effort to a local host" holds: desktop strips it (useSubmitWorkspace.ts:294), mobile sends effort only on the terminal branch (useCreateTerminalWorkspace.ts:152), automations send no effort (automation/hostSession.ts:82). tRPC compat: cloudWorkspace.create gains an optional input (safe); host-service sessions.create is .strict(), so a future client sending effort must gate on host version.
Evidence
Surfaces: CLI (ws create for cloud), API (cloudWorkspace.create), host-service (sessions/agents chat launch). There is no UI change. Evidence is the PR's own tests run at base and head source, plus typecheck/lint.
New tests against base source (a82221c5), with the PR's test files: each targeted test fails as expected.
# PR tests run against BASE source (a82221c5011d5f04d77504d21b067c6d165cc662) bunfig.toml drizzle.config.ts tsconfig.types.json (fail) continuationTarget > launches a chat only when asked for one with an ACP harness [27.86ms] ZodError: [ (fail) sessions router > starts the agent at the reasoning effort the caller asked for [24.46ms] 81 pass 2 fail bunfig.toml (fail) cloudWorkspace.create > files the new workspace under the caller's tags [13.40ms] 5 pass 1 fail bunfig.toml cli.config.ts CLIError: --tag does not apply to a cloud workspace (fail) sends --tag to the cloud [0.48ms] 8 pass 1 fail
Same tests at head 768d0a65: all pass.
# PR tests at HEAD 768d0a65 83 pass 0 fail Ran 83 tests across 2 files. [3.56s] 6 pass 0 fail Ran 6 tests across 1 file. [3.15s] 9 pass 0 fail Ran 9 tests across 1 file. [114.00ms]
Not run: an end-to-end superset ws create --agent claude --effort high --tag test against a real cloud workspace. This review run may not create workspaces, and the effort part needs the next sandbox production-release anyway. The sandbox-self-seed.ts one-line change has no direct test (as the PR states).
Questions for the author
- Should a bad
--efforton a cloud chat be reported anywhere (workspace activity, CLI output), or is the silent fallback to the agent default the intended UX? - Do you plan the desktop follow-up (
useSubmitWorkspace.ts:294) in this ticket? If so, it needs a host-version gate becausesessions.createis strict on older hosts. - Do the desktop/web cloud composers need a tag picker to use the new
tagsinput, or is CLI/SDK the only target for now?
Test / CI notes
- At
768d0a65: host-servicesessions.test.ts+agents.test.ts83 pass; trpccloud-workspace.test.ts6 pass; clicreateCloudWorkspace.test.ts9 pass. - Same tests with base source files: 4 fail (the 4 new/changed tests), all others pass.
tsctypecheck clean for trpc, cli and host-service.biome checkon the 10 changed files: clean.- CI at review time: Test, Sherif, Version Sync, Boot twice, Deploy API/Web/Docs passed; Lint, Typecheck, Build CLI, Vale were still running. No failures seen.