Skip to content

Commit e981f23

Browse files
fix(server): a new worktree thread's agent starts on its renamed branch
The branch rename ran in a background fiber that the run release did not wait for, so the agent started its turn on the temporary t3/<id> branch. Join the rename before releasing the run. Fixes #33397 AI-assisted; verified with the tests and tools listed above.
1 parent ce08d58 commit e981f23

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎apps/server/src/orchestration-v2/ThreadLaunchService.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ const make = Effect.gen(function* () {
719719
} else {
720720
yield* setupTracker.stageStatus(threadId, "setup-script", "skipped");
721721
}
722+
// The agent must start on the branch name the thread will show.
723+
if (branchRename !== null) yield* Fiber.join(branchRename);
722724
yield* setupTracker.markUncancellable(threadId);
723725
yield* setupTracker.stageStatus(threadId, "agent", "running");
724726
if (runId !== null) {

0 commit comments

Comments
 (0)