fix(agent-manager): speed up worktree session startup - #13447
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
Reviewed by grok-4.6 · Input: 140.1K · Output: 18K · Cached: 502.3K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
August 26, 2026 07:11
WebReflection
approved these changes
Aug 26, 2026
This was referenced Aug 26, 2026
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.
What Problem This Solves
Creating an Agent Manager worktree waits on Git checkout and then keeps the successful setup overlay visible after the session is ready. Large repositories also spend unnecessary time enumerating remote-tracking branches during local branch collision checks.
Why This Change Was Made
Use Git's built-in parallel checkout with two workers when the repository has no explicit
checkout.workerssetting, while preserving explicit user configuration. Limit collision detection to local branch refs, which are the only refs that can conflict with a new local branch. Dismiss successful setup feedback immediately after readiness while retaining the error delay.User Impact
The first usable Agent Manager session was measured at approximately 4.37 seconds before these changes and 2.65 seconds after them.
The measurements used a disposable repository with 9,640 tracked files and 424 Git LFS files. The total varies with repository size, Git LFS content, disk speed, hooks, setup scripts, remote latency, and host load.
Safety Validation
The checkout still uses a fresh remote commit, standard
git worktree add, Git LFS, and post-checkout hooks. Explicit user-definedcheckout.workersvalues remain unchanged. Branch collision tests cover local branches and remote-tracking refs.check-kilocode-changepassed.