Repository navigation
Conversation
…rktree A draft clears its composer on send but was only marked promoting once the server thread appeared. Until then new-thread flows saw an empty draft that was already open and reused it, so Cmd+Shift+N did nothing during worktree setup. Mark the draft promoting at send time, restore it on failure, and only follow a draft's thread in ThreadRouteView once the client knows it exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized web bug fix that adjusts draft promotion, routing, and failure recovery while worktree setup is pending, without changing schemas, defaults, infrastructure, or sensitive code. An unresolved Medium-severity finding does identify possible stale promoted-draft metadata after successful foreground sends. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Note This comment is posted by Julius' dot The screenshots show setup and new-draft states, but not Cmd+Shift+N taking effect before setup finishes. The verification rule requires a short recording for this timing-dependent interaction. Closing for that missing evidence. Please attach before/after recordings of the sequence and request reconsideration. |
[claude-opus-5-5] Responding on behalf of GuilleAdded the before/after recordings of the timing-dependent sequence to the description. They show the key presses on screen while worktree setup is still fetching the base branch.
Requesting reconsideration. The branch also has 0e00b92, which addresses Macroscope's finding (finalize the sent draft once the user has left it). That commit landed after the close, so the PR head still shows 4ee7dec until it is reopened. I can't reopen it from my side. |
[claude-opus-5-5] Responding on behalf of GuilleSuperseded by #14538. It has the same fix plus the Macroscope follow-up, with before/after recordings of the sequence in the description. |
After sending the first prompt of a draft in New worktree mode, Cmd+Shift+N did nothing until the server had created the thread. With a slow
git fetchof the base branch that is several seconds of waiting before you can start the next thread.Cause: the draft clears its composer on send, but was only marked promoting once the server thread showed up. Until then
useNewThreadHandlersaw an empty, unpromoted draft that was already open, reused it, and returned without navigating. Background sends (Mod+Enter) already marked the draft promoting at send time, so they were not affected.Fix
ChatViewmarks every local draft promoting when its send starts, not only background sends. New-thread flows then mint a fresh draft, and the store keeps the in-flight draft instead of garbage-collecting it.ThreadRouteViewfinalizes it after the route swap.restoreFailedBackgroundDraftThreadrenamed torestoreFailedDraftThread). Foreground sends still rotate a deleted thread's id in their existing block.ThreadRouteViewfollows a draft's thread only once the client knows it exists.promotedTois always the draft's own thread ref, so this changes nothing after creation, but avoids fetching a thread detail that 404s about once a second until the server creates it.This is a small fix for an obvious bug in an existing shortcut, so it has no prior issue.
Verification
Reproduced in an isolated Playwright browser against
vp run devwith worktree-local.t3state. Repo withorigin, workspace New worktree, From origin/main. To make setup slow, I used a 25 sremote.origin.uploadpacksleep for the fetch and a 25 spost-checkouthook for the checkout. Steps: Cmd+Shift+N, type a prompt, Enter, then Cmd+Shift+N again during "Setting up worktree…"./draft/<id>and the setup card stayed on screen.Recordings of the full sequence (a black pill shows each key press, "Enter: send" then "Cmd+Shift+N"):
Before: the first prompt starts worktree setup, then Cmd+Shift+N is pressed twice while "Fetch base branch" runs. Nothing changes; the draft and its setup card stay on screen.
After: same sequence. Cmd+Shift+N opens a new draft while the first thread is still fetching, and the next prompt can be typed right away.
MP4 versions: before, after
Stills:
Checks:
vp test run src/composerDraftStore.test.ts src/hooks/useHandleNewThread.test.ts src/components/ChatView.logic.test.ts(297 passed)apps/webtypecheckvp lint(only pre-existing warnings at untouched lines)vp fmt --checkNot checked: mobile (separate composer and send path, unchanged) and the desktop shell (wraps the same web code). I added no new unit test. The change is wiring inside
ChatView's send path, and a test there would only restate the edit.Made by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running in T3 Code.