Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
In a multi-root workspace (a .code-workspace with 29 git repositories as folders), each active Agent
workbench makes its extension host spawn git at a sustained ~500 processes per minute while agents are
working. The Git output log for one 8-hour session (4-6 concurrent agents, 16 workbenches) recorded 32,715
git commands.
Only 573 of those were the stock VS Code git status refresh. The rest are Cursor-specific callers that fan
out across EVERY workspace root: GitProvider.getAllBranchNames (3,211 calls, 27,258 s of git process time;
bursts of 56 = 2 commands x 28 repos every 3-13 s per active workbench), findGitRoot (4,572 calls, 48,415 s;
one rev-parse --show-toplevel per file the agent touches, plus ~8,300 unlabeled rev-parse calls),
getGitRemoteUrl / getGitRepoPathForWorkspacePath / pushGitWorkspaceCaches (~3,200 calls, ~33,000 s). Under
this load git rev-parse --show-toplevel averaged 10.6 s per call vs ~10 ms on an idle machine, and
50-200 git processes were alive at any instant.
This is not a network problem, although it presents as one: extension hosts log 40-200 “became UNRESPONSIVE”
events per 5 minutes, Settings > Network reports “Streaming responses are being buffered by a proxy” /
“Bidirectional streaming is not supported by the http2 proxy”, and agents stall into “Continue Working” —
while an external Node process running the identical SSE and HTTP/2 health checks passes at the same moment.
On a managed corporate laptop (endpoint security agent inspecting process creation and image loads, as is
standard in enterprises) process start is expensive, so this spawn rate saturates the CPU.
Steps to Reproduce
- Create a .code-workspace with 20+ folders, each a separate git repository (any repos; sizes don’t
matter much — the cost scales with the number of roots). - Open it and start 3-4 agents in Agents View doing ordinary file-editing work.
- View > Output, select the “Git” channel for any of the workbenches.
- Observe bursts of
> git branch --format=... (GitProvider.getAllBranchNames)and
> git branch --all --format=... (GitProvider.getAllBranchNames)— two per root, all completing within
the same second — recurring every few seconds while the agent is active. - Observe
> git rev-parse --show-toplevel [...ms] (findGitRoot)in bursts proportional to files touched. - Count lines per minute across workbenches (
> gitlines with timestamps): ~500/min with 4-5 agents. - Optional: on a machine with endpoint security installed, watch Task Manager — CPU pins, kernel time
dominates, and Cursor’s own Settings > Network diagnostics start failing with proxy messages even
though nothing on the network changed.
Expected Behavior
- Branch lists change only when refs change. Invalidate the branch-name cache on HEAD/ref changes, not on
everygit status, and fetch for the repository the agent is working in (or the picker is open for),
not all roots on every invalidation. - Memoize findGitRoot by directory, or resolve it from the known workspace-root → repository mapping,
instead of spawning git once per file path. - Cache remote URL / repository path per root for the session; re-resolve only on workspace-folder or
.git/config change. - Cap concurrent git spawns per extension host. 56 simultaneous
git branch --allprocesses is strictly
worse than 4 at a time. - Settings > Network should not attribute late-arriving stream chunks to a proxy when the local extension
host is starved; a hint like “extension host unresponsive during test” would have saved days.
Operating System
Windows 10/11
Version Information
Version: 3.20.21
VSCode Version: 1.128.0
Commit: f09fca384ceca23f7bf21f9c23655b162641d740
Date: 2026-09-13T19:02:51.781Z
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
OS: Windows_NT x64 10.0.26200
For AI issues: which model did you use?
N/A – not model-related (extension-host / git integration behavior, independent of model)
For AI issues: add Request ID with privacy disabled
N/A – not tied to a single request. Account is on an enterprise plan with Privacy Mode enabled (no training).
Additional Information
Environment: git 2.53.0.windows.1; git.autorefresh: false and files.watcherExclude set — no effect on
the callers below (they are not the stock refresh path). Reducing the workspace to 8 roots cuts the
per-root callers proportionally, but findGitRoot (per file) is unchanged.
Branch-tracker burst from one workbench’s Git output channel — branch and branch --all for every root,
all completing in the same second, each taking 2-4 s because ~56 run at once:
2026-09-11 13:56:34.837 [info] > git branch --all --format=%(refname:short) --sort=-committerdate [3769ms] (GitProvider.getAllBranchNames)
2026-09-11 13:56:34.838 [info] > git branch --format=%(refname:short) --sort=-committerdate [3713ms] (GitProvider.getAllBranchNames)
2026-09-11 13:56:34.839 [info] > git branch --format=%(refname:short) --sort=-committerdate [3826ms] (GitProvider.getAllBranchNames)
2026-09-11 13:56:34.839 [info] > git branch --all --format=%(refname:short) --sort=-committerdate [3622ms] (GitProvider.getAllBranchNames)
... (52 more identical lines within the same second)
Seconds between successive bursts in that workbench: 11 4 8 8 13 3 11 7 8 9 6 7 8 19 7 7 7 5 5 8 10 8 22 7 6 5 4
Per-file root lookups — 28 completing in the same second, 10-13 s each:
2026-09-11 13:58:50.168 [info] > git rev-parse --show-toplevel [11786ms] (findGitRoot)
2026-09-11 13:58:50.315 [info] > git rev-parse --show-toplevel [12910ms] (findGitRoot)
2026-09-11 13:58:50.336 [info] > git rev-parse --show-toplevel [11588ms] (findGitRoot)
2026-09-11 13:58:51.922 [info] > git rev-parse --show-toplevel [10465ms] (findGitRoot)
2026-09-11 13:58:51.922 [info] > git rev-parse --show-toplevel [10606ms] (findGitRoot)
Per-minute totals across all workbenches in one 5-minute window: 499, 573, 530, 461, 565 commands;
3,000-11,800 git-process-seconds per minute.
Where it comes from, from reading workbench.desktop.main.js in 3.20.21:
- localAgentBranchOptionsTracker / localAgentBranchNames.js tracks every SCM repository in the workspace
(_refreshTrackedRepoPaths), fetches getAllBranchNames twice per repo (includeRemotes false/true), and has
a 300 s cache (Veo = 300*1e3) that is invalidated on every onDidRunGitStatus and onDidGitHeadChange. With
agents writing files, git status runs continuously, so the cache is never warm; _refreshTrackedRepoPaths
also re-fetches on every onDidUpdateRepository. - findGitRoot (gitignore provider / retrieval) issues a fresh
rev-parse --show-toplevelper file path with
no visible memoization, although the answer is constant for every file under a workspace root. - None of this is user-configurable; no cursor.* setting affects these callers.
Happy to share the full Git.*.log files with support privately (they contain on-disk paths).
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor