Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- On Windows desktop 0.1.11, have a large install: ~8,860 live threads (0 archived), of which ~1,775 are delegated-task threads. 8,192 threads have a branch and 7,269 have a
worktreePath, but only 532 of those worktree folders still exist on disk. 17 projects, ~50 git working dirs touched at start.statev2.sqliteis 6.6 GB. - Start T3 Code.
- Watch the backend child's private memory in Task Manager.
Expected behavior
The backend starts and stays well below the V8 heap limit. Start-up branch PR lookups are bounded and coalesced per (repo, branch), and threads whose worktree is gone, or that are settled, don't each cost a lookup.
Actual behavior
The backend child climbs from ~1.4 GB to over 5 GB private memory within about a minute (sampled every 8 s: 1407 → 1504 → 2352 → 2772 → 3815 → 4301 → 5347 MB, then 7.6 GB shortly after). It then aborts with FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory (exit code 134), 2–3 minutes after start. The desktop restarts it, and the cycle repeats. From the user's side, "T3 Code keeps restarting".
Crash counts from server-child.log (exit 134, all OOM): 12 on 11-18, 6 on 11-19, 1 on 11-20, 7 on 11-21, 23 on 11-22. On bad days they come in bursts about 5 minutes apart, which is just the start → OOM time.
During the climb, server.trace.ndjson is dominated by branch PR lookups. In the 2 minutes before one OOM:
| span | count | summed duration |
|---|---|---|
runGitCommand |
2232 | 148 s |
GitVcsDriver.readConfigValue |
731 | 116 s |
lookupBranchPullRequest |
181 | 252 s (max 27.9 s) |
resolveLookupHeadContext |
181 | 109 s |
findPublishedBranchRemote / findRemoteTrackingRemote / isUnpublishedBranch |
~175 each | 50–95 s each |
ThreadPullRequestServiceV2.resolveProject |
180 | — |
Up to 9 git processes ran at once, across 50 distinct cwds. The main project repo alone took 3,347 git spans in 3 minutes. The lookups' summed memory.heap_growth_bytes is the largest of any span family (lookupBranchPullRequest ≈ 3.7 GB summed over the window), but these numbers are inclusive and overlapping, so I can't prove they retain the heap. I'm reporting them as the dominant start-up activity during the climb, not as a confirmed leak site.
Other start-up noise in the same window: 53× storage cleanup failed for worktree (git worktree remove → fatal: failed to delete '<worktree>'), plus repeated thread branch pull request lookup failed for a repo that no longer exists on GitHub (GitHubApiNotFoundError: Could not resolve to a Repository).
Unlike #40761, this isn't a one-off reading under unusual load. The same start → OOM cycle has repeated across five days (59 OOM aborts in the log), and the failure is a hard heap abort, not just slow git.
Related, not duplicates:
- [Bug]: Server start runs a branch PR lookup per thread, not per (repo, branch): 67 lookups / 760 git processes on one repo, git calls up to 135 s on Windows #40761: per-thread (not per repo/branch) branch PR lookups at start. Closed as not planned because its CPU numbers were confounded. This report shows the same fan-out at ~5× the thread count, ending in a reproducible OOM crash loop rather than high CPU.
- Each branch pull-request lookup on Windows starts 14 git processes, and 5 of them re-read what the same lookup already read: 42 git at every server start for 3 branches #40089 / perf(server): branch PR lookups start 9 git processes instead of 14 #40153: git processes per lookup.
- [Bug]: Backend child OOM-crashes while writing a 307 MB usage-scan cache (usage-scan-cache-v11.json) #34018: a different backend-child OOM (usage-scan cache). The usage-scan cache here is only 47 MB.
- [Bug]: Opening a thread freezes the desktop renderer for ~1 min when there are ~13k threads:
environment-quiet-thread-shell-listrebuilds ~14k times over every thread #25823: other ~10k+ thread scaling issues.
Impact
Blocks work completely
Version or commit
0.1.11 (desktop, stable)
Environment
Windows 11 Pro 26300, T3 Code (Beta) desktop 0.1.11, Git for Windows. Providers: Claude (mostly) plus delegated tasks.
Logs or stack traces
[14668:000001E0004A8000] 182261 ms: Mark-Compact (reduce) 3847.5 (3904.7) -> 3847.5 (3901.2) MB, pooled: 0.0 MB, 1242.98 / 0.00 ms (average mu = 0.025, current mu = 0.002) last resort; GC in old space requested
[14668:000001E0004A8000] 183510 ms: Mark-Compact (reduce) 3847.5 (3901.2) -> 3847.5 (3899.9) MB, pooled: 0.0 MB, 1249.22 / 0.00 ms (average mu = 0.013, current mu = 0.000) last resort; GC in old space requested
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 00007FF7BBCC3186 node::SetAbortHandler+54
2: 00007FF7BBCC3531 node::OnFatalError+881
...
backend child process failure output end pid=14668 code=134event-loop-stalls.ndjson before earlier crashes: delayMaxMs 2–9 s, utilization: 1, rssMb 7,400–8,200, 350k–515k major page faults per sample.
Workaround
None confirmed yet. The plan is to bulk-archive old threads, especially delegated-task threads and threads whose worktree folder is gone, to shrink the per-thread lookup set.
Activity
fix(server): cap the startup PR backfill to the most recent settled t…
garrettluskey commentedon Nov 23, 2026
Related feature request with this install's numbers: auto-archive for settled threads, placed next to the "Delete inactive worktrees" setting — #15076 (comment). Without it there's no way to keep the live-thread set (and so the start-up PR lookup fan-out) bounded short of one archive call per thread.