Skip to content

fix(web): new worktree sends wait for their branch, and invite answers can't go twice - #1012

Merged
badcuban merged 3 commits into
mainfrom
fix/reviewer-invite-base-branch
Nov 20, 2026
Merged

badcuban merged 3 commits into
mainfrom
fix/reviewer-invite-base-branch

Conversation

@badcuban

@badcuban badcuban commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

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 (fetchNewWorktreeBaseBranch in useNewWorktreeBaseBranch.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.

…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.
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 20, 2026 5:22pm UTC

Request Review

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.
@badcuban
badcuban added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 801f8e2 Nov 20, 2026
23 checks passed
@badcuban
badcuban deleted the fix/reviewer-invite-base-branch branch November 20, 2026 17:33

This branch was previously deployed

1 inactive deployment
Preview — d3056bb9 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant