Repository navigation
🤖 fix: a new workspace waits for its branch list before it can be sent - #6035
Conversation
While the creation view's branch list loads, the trunk branch is empty, and the backend refuses every runtime except local with "Trunk branch is required for worktree and SSH runtimes". Send (button, Enter and slash commands) now stays disabled until the list loads, except for the local runtime and scratch chats. Fixes #6033 --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 719a729af7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ProjectPage's "Run /init" banner calls the composer's imperative send() once. With Send gated while the branch list loads (#6033), that call was refused and nothing retried it, so the click did nothing. The composer now keeps an imperative send made while the branches load and sends it once they have loaded. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4e9028b57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The deferred send kept only the fact that send() was called, so a user who replaced /init with another prompt while the branch list loaded had that prompt sent without pressing Send. The deferred send now holds the draft text at the time of the call, and any edit withdraws it. The edited text stays in the composer for the user to send. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c07d6879d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…robe The creation view loaded branches and runtime availability with one Promise.allSettled and marked the branches loaded only after both settled. With Send now gated on the branch list (#6033), the runtime probe (Docker, Podman, devcontainer CLI, multi-second timeouts) held worktree and SSH sends even after the branches were ready. Each request now settles on its own. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fa1105429
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Three review rounds found new holes in the deferred send (an edited draft sent without a Send press, the dev container runtime probe dropping the intent, attachments added after the click uploaded on their own). Scope reduction: the imperative send() is refused while the branch list loads like any other send. "Run /init" leaves /init in the composer, and the user presses Send once the branches load. The Send gate and the independent branch loader stay. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Since #6032, openProjectCreationView waits for the branch selector. The #6033 tests hold listBranches before they open the view, so on main the helper timed out ("Source branches not loaded"). The tests now open the view with their own click-and-wait for the composer. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Summary
In a new-workspace (creation) view, Send now stays disabled until the project's branch list has loaded. Before this change, a send in that window failed with the error toast "Trunk branch is required for worktree and SSH runtimes". Local and scratch chats are not gated.
Fixes #6033
Background
Until the branch list loads, the trunk branch is
""(useDraftWorkspaceSettings.ts), and the creation send passed it toworkspace.createwith no check. The backend refuses every runtime exceptlocalwithout a trunk (workspaceService.ts).What a user saw (repro on a production build of
9c1d222f47, branch list delayed by agitwrapper that sleeps onfor-each-ref):Implementation
ChatInput/index.tsxadds one term tocanSend, next to the existingcoderPresetsLoadingterm: a creation composer (not scratch) whose branches have not loaded, with any runtime exceptRUNTIME_MODE.LOCAL.canSendalready gates the button, Enter and slash commands (sendComposerInputreturns early on!canSend). This mirrors the backend rule:buildRuntimeConfigmaps onlyLOCALtotype: "local". The change adds no new copy, tooltip or spinner, because the picker's skeleton already shows that the list is loading.Project switch: the gate cannot stay open from another project.
ProjectPage.tsxkeys the creationChatInputby${projectPath}:${pendingDraftId}, so a project switch remounts it withbranchesLoaded=false. The load effect also resetsbranchesLoadedwhenprojectPathchanges (useCreationWorkspace.ts).Validation
tests/ui/agents/creationWaitsForBranches.test.ts(new, real backend):projectService.listBranchesis held on a promise.workspaceService.creategets a non-empty trunk.creationGoalFormalRepro,creationSlashCommands,newChatStreamingFlash,docker,initBanner).tests/ui/workspaces/nameGeneration.test.tsalso fails on the base commit. That is tests: 3 tests/ui tests fail on main (creationGoalFormalRepro, nameGeneration) #6016, which 🤖 tests: wait for the branch list before sending from a creation view #6032 fixes.Dogfood (production build of this branch, branch list delayed):
Send disabled while the list loads (1280 px):

Send enabled once the picker shows

main:Send disabled while the list loads (390 px). The layout is unchanged:

Recording (36 s): Enter during loading does nothing, Send turns on, and the send creates the workspace with no error.
send-waits-for-branches.mp4
Risks
Low. The change only makes Send unavailable for a short time in the creation view: until
listBranchessettles, which includes a failed call. IflistBranchesrejects, the old backend toast still explains it, as it did before.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$262.60