Repository navigation
Worktree threads wait at most 2 s for the AI branch name - #80
Merged
Merged
Conversation
A new worktree thread's agent waited for the AI branch name (a Codex CLI call, 4 to 8 s measured), so a worktree took about 9 s to start. The rename now races the AI against the first six words of the prompt, which win once 2 s have passed since the worktree exists and a blocking setup script has ended. The AI call is stopped when it loses. Verified: ThreadLaunchService tests 86/86 (the two new ones fail when the race or the setup wait is removed); check:changed typecheck and format pass, its lint/test/react-compiler failures are in untouched fork files; e2e on a patched test server against treeroute: agent started at 3.34 s (was 8.4 s) with prompt name, and at 5.56 s with the AI name while a 4 s setup script ran Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
New worktree threads took about 9 s to start. The server trace shows why: worktree fetch and checkout take about 1.2 s, then the launch waits for the AI branch name (Codex CLI,
gpt-6-luna). That call took 3.8 to 8.3 s on this machine, and effort or model changes don't make it faster (an immediately failing call still takes ~3 s; Haiku viaclaude -ptook 2.4 to 4.7 s).Change
[STT]dropped, usual prefix). The prompt name wins only once 2 s have passed since the worktree exists and a blocking setup script has ended, so a setup script that takes longer gives the AI its full time at no cost. The AI call is stopped when it loses.instantBranchName.ts;ThreadLaunchService.tsgets aDeferredand the race. Documented inFORK.md.Verification
ThreadLaunchService.test.ts: 86/86. Upstream's "starts the agent on the temporary branch when branch naming hangs" is replaced by "names the branch from the prompt when the AI branch name is late" (the behavior this PR changes on purpose); one new test covers a blocking setup script. Each new test fails when its part of the change is removed.vp run check:changed: typecheck (43 packages) and format pass. Lint, test, and react-compiler failures are in untouched fork files (dictation, orchestrator, voice input); "unused patches" needs pnpm on PATH.t3/why-do-worktrees-rn-take-9secondsasync: false, ~4 s): agent started 5.56 s with the AI namet3/sativa-veraltete-preise,node_modulesand database in place🤖 Generated with Claude Code