fix(agent-manager): reduce background Git and GitHub process churn - #13463
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous Review Summary (commit 743fafc)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 743fafc)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (14 files)
Reviewed by grok-4.6 · Input: 59K · Output: 7.7K · Cached: 269.4K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
August 26, 2026 12:04
iscekic
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
Agent Manager repeatedly starts Git and GitHub CLI subprocesses while projects remain open. Each project refresh previously ran a separate
git worktree list, the embedded chat provider created another Git stats poller, and PR badges fetched metadata, checks, and reviewers through separateghcommands. With multiple projects and worktrees, this creates sustained background process churn.Why This Change Was Made
The existing
git for-each-refquery can return checked-out worktree paths alongside refs and upstreams, so normal worktree presence checks do not need another Git process. Agent Manager already owns project-scoped Git polling, so its embeddedKiloProvidermust not start a duplicate poller. GitHub CLI can also return check rollups, review requests, and complete review history in the existinggh pr viewresponse.The implementation preserves existing polling intervals and external Git-change detection. It falls back to
git worktree listfor detached worktrees, incomplete metadata, and Git versions without%(worktreepath). PR lookups remain scoped by project, detached worktrees keep separate cache entries, and older GitHub CLI versions or restricted tokens fall back once to the existing basic request without repeating failed capability probes. Complete review history is retained so a later comment does not erase an earlier approval.User Impact
Agent Manager uses fewer background processes with multiple projects while preserving branch changes, staged and untracked diffs, ahead/behind counts, CI status, review decisions, file search, and the existing CLI behavior. The change does not introduce file watchers, replace the existing file-search implementation, or modify shared upstream OpenCode source.
Evidence
Identical isolated VS Code runs used two expanded projects, eight managed worktrees, and a 25-second observation window.
git worktree listsubprocessesPR enrichment was verified independently because the disposable benchmark repositories do not have GitHub pull requests.
ghsubprocessesgh pr viewsubprocessgh repo viewper worktreeA real GitHub PR response returned 22 checks and its reviewer history through the combined command. Automated coverage includes two repositories with matching branch names, detached worktrees, unsupported Git atoms, unknown GitHub fields, restricted GitHub tokens, cancelled checks, and approvals followed by comments.
Validation: all 4,217 VS Code extension unit tests passed, along with extension typecheck, lint, Knip, formatting, and upstream annotation checks. Real UI verification covered both projects, external edits, staged changes, commits, branch renames, detached worktrees, project-specific diffs, and newly created files appearing in search.