fix(workspaces): all adapters enabled on every create path (quick-chat agent default)#354
Merged
Conversation
…plate head Quick-chat (Ask Alice → POST /quick-chat) created its daily chat workspace with only claude+codex. Root cause: the "every registered adapter enabled" policy lived solely in the frontend create hook, which expanded the list before POSTing. Quick-chat is a backend-only caller — it calls WorkspaceCreator.create() directly with no agent set, so it fell through to the bare template.defaultAgents (["claude","codex"]), the same default the hook's comment already called "wrong". Move the policy into the domain layer: new resolveCreateAgents() in workspace-creator.ts is the single home — explicit subset wins verbatim, otherwise all registered adapters with template.defaultAgents as the order-head (so agents[0], the new-session default, still follows template intent). Form, quick-chat, and headless now converge on it. Thin the frontend: useCreateWorkspace sends no agent set; createWorkspace's agents arg is optional; the now-dead `agents` prop is dropped from CreateWorkspaceForm/Dialog and its three call sites (display-only `agents` in Sidebar/TemplateDetail is untouched). Demo: /quick-chat handler returned demoWorkspaces[0] (the aapl-q1 workspace, agents:['claude']) — wrong target and it reproduced the same visual bug. Point it at demoChatWorkspace, which already carries all four agents. Test plan: - npx tsc --noEmit (Alice) clean; cd ui && npx tsc -b clean - workspaces suite green (139 tests incl. 5 new resolveCreateAgents cases) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WorkspaceCreator.create()directly, so it fell through to the baretemplate.defaultAgents(["claude","codex"]) — the default the hook's own comment already called "wrong". From Ask Alice, the daily workspace silently dropped opencode + pi.resolveCreateAgents()inworkspace-creator.tsis the single source of truth: an explicit subset wins verbatim, otherwise all registered adapters withtemplate.defaultAgentsas the order-head (soagents[0], the new-session default, still follows template intent). Form, quick-chat, and headless converge on it.useCreateWorkspaceno longer expands/sends an agent set;createWorkspace'sagentsarg is optional; the now-deadagentsprop is dropped fromCreateWorkspaceForm/CreateWorkspaceDialogand its three call sites (display-onlyagentsin Sidebar / TemplateDetail untouched)./quick-chathandler returneddemoWorkspaces[0](theaapl-q1workspace,agents:['claude']) — wrong target that reproduced the same visual bug; now points atdemoChatWorkspace, which already carries all four agents.Test plan
npx tsc --noEmit(Alice) cleancd ui && npx tsc -bcleanpnpm testworkspaces suite green — 139 tests incl. 5 newresolveCreateAgentscases (no-pin → all; head only orders; dedupe; explicit subset verbatim; empty array = not pinned)Boundary touch
None. Workspace launcher only — no trading / auth / broker credentials / migrations.
🤖 Generated with Claude Code