Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Worktree branch naming can time out before checkout finishes #48267

ClosedAlb11747(GitHub profile, opens in a new tab) opened this issue 1 comment

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

In the ThreadLaunchService test harness, gate a synthetic checkout and a branch-name response on separate deferreds. Launch a new worktree thread with an initial message and no explicit branch. Once both operations start, advance the test clock by 21 seconds, then let checkout and name generation complete.

Expected behavior

Let name generation overlap checkout and bound the time it can delay agent startup after checkout. If generation still fails, use a branch name derived from the thread title or first request.

Actual behavior

T3 starts the 20-second timer before checkout and later joins the same generation fiber. If generation is still pending at 20 seconds, it expires even while checkout is still running. The thread starts on t3/<hex> and shows “Branch not renamed.”

This happened in three of four launches on a large repository with Codex text generation. Checkout took 38–87 seconds, and fresh codex exec startup took 6–15 seconds. Upstream code reviewed at a75e74eb48. Timeout, early fork, checkout, join.

Related to #41381, which covers Antigravity runtime startup and cleanup.

Impact

Minor bug or occasional failure

Environment

Windows server with Codex text generation.

  1. tanstack-source added labelsbug

  2. I tried to reproduce this on the current build and could not.

    Commit 7ca670595c (origin/main). Not reproduced in a real app run: that needs a branch-name text generation that reliably takes more than 20 s alongside a slow checkout, and none of the providers on this VM can be made to do that without a stub. Shown instead with the reporter's own harness steps in apps/server/src/orchestration-v2/ThreadLaunchService.test.ts (new test "renames a temporary branch when naming outlasts its timeout only during checkout"). createWorktree and generateBranchName are each held on a Deferred. A worktree thread is launched with an initial message and no branch. Once both have started, TestClock advances 21 s, then naming and checkout are released. On main the test fails: the projection has a "Branch not renamed" system notice, renameBranch is never called, and the thread keeps its temporary t3/ branch. Command: vp test run src/orchestration-v2/ThreadLaunchService.test.ts -t "outlasts its timeout" from apps/server. Searches found no duplicate. #41381 is related (Antigravity startup time counts against the same 20 s BRANCH_NAME_TIMEOUT), and closed #36889 added the timeout.

    Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.

  3. juliusmarminge closed this

Sign in to join this conversation.