Repository navigation
Description
What happened
The machine's disk filled to 100% and agents' git commands started failing with No space left on device. The biggest single cause was 23 partial packs (.git/objects/pack/tmp_pack_*, about 300 MB each, 6.4 GB in total) in one repository, one written per hour for 23 hours. Storage cleanup has "remove worktrees when their PR merges" turned on.
Diagnosis
The hourly sweep (storageCleanup.ts:1567, Schedule.spaced("1 hour")) runs a merge check for clean worktrees that aren't otherwise eligible. It calls git.fetchRemoteTrackingBranch (storageCleanup.ts:1158), which runs git fetch --quiet --no-tags -- <remote> +refs/heads/<default>:refs/remotes/<remote>/<default> through runGit with no timeoutMs (vcs/GitVcsDriverCore.ts:5068). So it gets the 30 s DEFAULT_TIMEOUT_MS, and it runs without --no-auto-gc.
The remote's default branch was about 18,000 commits ahead, so the fetch can't finish in 30 s. T3 kills git, index-pack leaves its tmp_pack_*, and the next sweep starts over: one ~300 MB leftover per hour. The merge check never completes either, so the project's merged worktrees are never removed.
fetchRemoteForStatus already handles this case (comment at GitVcsDriverCore.ts:1379) with --no-auto-gc and a 5-minute timeout. Lines are from v0.1.10-nightly.20261112.4606; the same code is on main (e9d5bae5) and in v0.1.11-nightly.20261117.4814.
Fix ideas: the status poll's timeout and --no-auto-gc, a per-repo backoff after a failed fetch, or a private object store like #23715.
Steps to reproduce
- Turn on "remove worktrees when their PR merges" (
storageCleanup.worktreeOnMerge: true). - Use a project whose
git fetch <remote> <default-branch>takes over 30 s (big backlog or slow link). To force one, pointmainandorigin/mainfar back withgit update-ref, drop newer refs, thengit reflog expire --expire=now --all && git gc --prune=now. - Give it a thread with a clean worktree (no local changes, active within
worktreeAfterDays, not settled). - Wait for the hourly sweep.
- 30 s after the fetch starts, a new
.git/objects/pack/tmp_pack_*appears andgit count-objects -vHlists it as garbage. Each sweep adds one.
Version
0.1.10-nightly.20261112.4606 (background service). Code unchanged on main e9d5bae and v0.1.11-nightly.20261117.4814.
Environment
Linux x64 (kernel 7.0.14, LXC container), Node v26.12.1, git 2.43.0, T3 running as a systemd user service
Evidence
# leftover partial packs, UTC, 23 in total, about 61 minutes apart
300172501 2026-11-16 02:19:20 tmp_pack_2TXjCx
298598105 2026-11-16 03:20:11 tmp_pack_ZsQcTc
...
294733634 2026-11-17 00:40:48 tmp_pack_JXgLFe
$ git count-objects -vH
packs: 26
size-pack: 759.87 MiB
garbage: 23
size-garbage: 6.40 GiB
# last fetch: FETCH_HEAD truncated at 00:40:18, its pack stopped growing at 00:40:48
# leftover pack header: PACK version 2, 264632 objects
# last fetch that landed
refs/remotes/origin/main@{2026-11-15 21:15:46 +0000}: fetch --quiet --no-tags -- origin +refs/heads/main:refs/remotes/origin/main: fast-forward
# GitHub compare, that commit...current default branch
status: ahead, ahead_by: 18132Related issues
#1965 and #3525 (same leak via the status poll's fetch, fixed with --no-auto-gc and a 5-minute timeout in fetchRemoteForStatus), #10916 / #20185 (start-from-origin fetch hitting the 30 s default), #3646 / #23715 (checkpoint variant). None covers the storage-cleanup merge-check fetch.
Fix applied or workaround
Deleted the 23 leftover tmp_pack_* files once no process held them open. Added a local timer that deletes objects/pack/tmp_* files over an hour old that nothing has open. After the project's merged worktrees were removed, the next sweep didn't run the fetch.
Filed by
Claude Code (claude-opus-5-5) via t3 triage
Activity