Repository navigation
fix(web): new worktree sends wait for their branch, and invite answers can't go twice - #1012
Merged
Merged
Conversation
…s can't go twice A first send in New worktree mode failed with "Select a base branch" while the branch list for the "New worktrees from" setting was still loading (1.5s typical, up to 16s on a busy repository), even though the footer already named a branch. The send and goal paths now wait for the same lookup the branch picker uses (fetchNewWorktreeBaseBranch, sharing its queries) and only fail when no branch fits. The agent invite card turned its buttons back on as soon as the answer returned, while the card stayed up until the thread update arrived. A second click in that gap was refused as an invite already answered. The buttons now stay off after a successful answer.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
From review of the first commit: - The branch, workspace and computer pickers below the composer are off while a message or goal is on its way. A first send can now wait seconds for its worktree's branch, and a branch picked in that window was ignored (or, once the message showed, acted as a checkout switch on the thread). - The send waits up to 15s for a computer's settings instead of 3s, so a slow-to-connect computer doesn't fail with "Couldn't find a branch". - An answered invite's buttons stay off when its thread is left and opened again before the thread update arrives.
… the box A send that fails before any command is dispatched (a new worktree's branch not found, an attachment that can't be read) used to stay in the chat as if sent when the user had started typing again, because the message only came back to an empty box. Now it always leaves the chat, and its text, attachments and contexts go back in the box ahead of whatever was written since. A send that failed in transit may have reached the server, so it still comes back only to an empty box.
This branch was previously deployed
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.
Two bugs from one session.
"Select a base branch before sending in New worktree mode" while the footer said "from main." Right after "New thread" (reliably when starting from a thread in a worktree), the draft has no saved base branch until the branch list for the "New worktrees from" setting loads. On a busy repository that list took 1.5s typical and up to 16s (from the live trace log). During that wait the footer showed the checkout's current branch as a guess, but the send refused.
The send now waits for the same lookup instead (
fetchNewWorktreeBaseBranchinuseNewWorktreeBaseBranch.ts, sharing the picker's queries so an in-flight lookup is joined). The composer shows "Sending" meanwhile. It fails only if no branch fits, and then the message goes back into the box. Setting a goal as a draft's first action had the same refusal and gets the same wait."Couldn't bring in GPT-6.2-Astra: This invite was already answered or is over." The first "Add to thread" worked; the server took about 4s to answer. When the answer returned, the card turned its buttons back on but stayed up until the thread update arrived, so a second click was refused. The buttons now stay off after a successful answer and come back only on failure.
Tests: one check added to each existing test file (
ChatView.sending.browser.tsx,ChatView.agents.browser.tsx); both fail against the old code. Browser files and related unit tests pass; fmt, lint and typecheck pass.Not in this PR: the footer can still name the checkout's branch for a moment before the setting's branch loads; branch listing itself is slow on large repositories.
After review: while a message or goal is on its way, the branch, workspace and computer pickers below the composer are off, so the place a waiting send uses can't change under it. The send waits up to 15s for a slow computer's settings. An answered invite's buttons stay off even if its thread is left and reopened before the update arrives.
Also: a send that fails before anything went to the server (branch not found, unreadable attachment) now always leaves the chat and goes back in the box, ahead of anything typed since. Before, it stayed in the chat as if sent when the box wasn't empty.