[Windows] Canceled turn-diff captures leave over 774 GiB of tmp_pack_* files in the repository
Summary
Codex Desktop’s automatic turn-diff capture repeatedly runs git add against my workspace. These operations are canceled when the Git snapshot becomes stale, leaving large tmp_pack_* files in the repository’s .git/objects/pack directory.
An initial inspection found 1,838 temporary pack files totaling 774.39 GiB. A later observation found 1,841 files totaling 775.69 GiB, so accumulation was continuing during the investigation.
This happens without a user-requested staging or commit operation.
Environment
- OS: Windows 10 Home, version 10.0.19045
- Installed package:
OpenAI.Codex_26.930.3930.0_x64__2p2nqsd0c76g0 - Application executable:
ChatGPT.exeinside that Codex package - Workspace: a local Git repository containing documents, projects, large binary artifacts and backups
- Repository configuration already includes
gc.auto=0
Disk usage
| Content | Observed size |
|---|---|
| Entire workspace | 821.91 GiB |
.git directory |
790.05 GiB |
.git/objects/pack |
775.64 GiB |
1,838 tmp_pack_* files |
774.39 GiB |
Four finalized .pack files |
1.25 GiB |
These are summed logical file sizes, not deduplicated allocated-size measurements. Finalized pack files do not represent the entire repository history; loose objects and LFS storage also exist.
The temporary files accumulated across multiple dates, with a sharp increase starting September 26. Files created September 27–30 alone account for approximately 568.58 GiB.
Observed process chain
A live process inspection captured:
Codex package / app / ChatGPT.exe
└─ Git / cmd / git.exe
└─ Git / mingw64 / bin / git.exe
The Git command was:
git -c safe.bareRepository=explicit
-c core.hooksPath=NUL
-c core.fsmonitor=
add --sparse --pathspec-from-file=- --pathspec-file-nul
The parent process was the desktop application, rather than a shell command issued by the assistant during the investigation.
Logs identify the operation and cancellation
The Git worker logs repeatedly contain:
cwd=<affected repository>
requestKind=turn-diff-capture-start
source=turn_diff_analytics
subcommand=add
aborted=true
failureReason=canceled
success=false
timedOut=false
For example, on October 4, 2026:
| Git cancellation time, UTC | Duration |
|---|---|
| 16:50:18.454 | 29.059 seconds |
| 16:58:30.930 | 91.096 seconds |
| 17:01:28.584 | 39.165 seconds |
| 17:05:15.687 | 94.832 seconds |
Immediately afterward, the main application log reports:
Failed to start turn diff analytics capture
errorMessage="Git snapshot became stale"
The corresponding temporary packs’ last-write times align with these cancellations, within approximately two seconds.
Read-only inspection of the installed application
Inspection of the installed app.asar shows the following path:
- A
turn/startedlistener can requestturn-diff-capture-start, subject to feature and account conditions. - The worker collects working-tree changes and untracked paths.
- It creates a temporary index and runs
git add, followed bygit write-tree. - The inspected temporary-index wrapper supplies
GIT_INDEX_FILE, but does not supply a separateGIT_OBJECT_DIRECTORY. - Snapshot invalidation retires the previous snapshot and aborts its signal.
- The Git execution path enables process-tree termination. The Windows implementation uses
taskkill.exe /pid … /t /f. - The wrapper’s cleanup removes its temporary index directory. No corresponding cleanup of abandoned packs in the repository object directory was found in this path.
The inspected diff-output size limit applies after snapshot construction; it does not bound the preceding object-writing operation.
This supports the following failure mechanism:
Automatic turn-diff capture
→ large untracked files are written as Git objects
→ snapshot becomes stale
→ Git is canceled
→ unfinished pack remains
→ a later capture repeats the work
What the temporary packs contain
A read-only, streaming inspection of one large temporary pack confirmed that its first two objects exactly match existing workspace files:
- An older application installer: 830,566,790 bytes
- A SQLite database in a local rollback backup: 1,195,106,304 bytes
Both matches were verified using full SHA-256 comparisons.
Further objects matched the sizes and formats of large JSONL files in that backup. Several packs from different dates also had the same installer prefix.
The unfinished pack header reported one object, but sequential inspection found additional objects. Its header therefore should not be treated as a finalized object count.
Observed conditions
The affected workspace contains large untracked files and is used for ordinary Codex conversations and file operations. The application’s turn-diff capture starts automatically; a manual Git staging or commit request is not required.
A minimal synthetic reproduction has not been performed. The evidence above comes from repeated observations in the affected workspace.
Expected behavior
- Automatic change capture should have a bounded disk-write budget.
- Canceling a capture should not leave large temporary packs accumulating indefinitely.
- Temporary snapshot storage should be isolated and safely reclaimed after cancellation.
- Large-file limits should apply before writing objects.
- Users should have a reliable way to disable automatic Git-writing features while retaining explicitly requested Git operations.
Related reports
- #28750 — Repeated automatic
git addoperations leave large temporary packs in the repository. - #19588 — Automatic snapshot operations fill disk space in a broad workspace.
- #43158 — Canceled workspace-diff collection leaves temporary Git objects on macOS; a related failure class with a different storage path.
Additional Windows Desktop case with the same background cancellation signature, but predominantly loose temporary objects rather than temporary packs.
Environment
- Windows 11 Pro, version 10.0.26300 (x64).
- Desktop MSIX package:
OpenAI.Codex_26.1007.9446.0_x64. - Git in the inspected workspace shell:
2.45.1.windows.1(the Desktop worker's Git executable/version was not separately verified). - A normal local project repository with research archives and SQLite backups, not a home-directory repository.
Disk impact
A saved inventory from October 14, 2026, obtained from git count-objects -v garbage warnings, recorded:
| Temporary files | Count | Logical bytes |
|---|---|---|
.git/objects/<fanout>/tmp_obj_* |
1,982 | 143,500,213,862 |
.git/objects/pack/tmp_pack_* |
172 | 3,165,128,720 |
| Total | 2,154 | 146,665,342,582 |
1,958 of the 1,982 loose temporary files had lengths aligned to 4,096 bytes. Most accumulated on October 13. Two fanout directories alone accounted for approximately 134.2 GB, consistent with repeated incomplete writes of large objects. The repository includes completed archive parts of approximately 92 MB.
Desktop logs
Project-scoped logs for October 13–14 contain 57 failed automatic git add operations, all with:
cwd=<private project repository>
source=turn_diff_analytics
requestKind=turn-diff-capture-start
subcommand=add
aborted=true
failureReason=canceled
success=false
timedOut=false
Observed durations range from 119 to 5,225 ms. These are cancellations, not evidence of a fixed five-second Git timeout. Read-only inspection of the installed worker also confirmed snapshot staging through a temporary GIT_INDEX_FILE and tracked/untracked git add operations.
Recovery and limits of the evidence
Only old Git-reported tmp_obj/tmp_pack garbage was removed after checking paths, sizes, mtimes and absence of active Git processes/locks. References were unchanged and Git connectivity checks passed; no valid objects, refs, reflogs or history were deleted.
The temporary contents were already removed before this causal investigation. Consequently, we cannot map every temporary file to a particular canceled operation or prove its exact input. The inventory and cancellation logs support the same failure class reported here, rather than a complete one-to-one causal reconstruction. No deliberate reproduction of the disk-growth failure was attempted.
This case suggests that cancellation/storage cleanup safeguards should cover both loose tmp_obj_* files and tmp_pack_* files. Existing project-level ignore rules can reduce large transient inputs, but cannot repair the application's cancellation behavior. Related cancellation report: #53874.
The figures above are logical file sizes. Private paths, session transcripts, credentials and project data are intentionally omitted.
I posted a Windows follow-up on #20933 with the same git add --sparse command and source=turn_diff_analytics cancellations. My live sample showed loose-object writes and severe disk pressure in a task-owned worktree. I also observed three blank/unresponsive UI incidents associated with disk pressure, with hang causation still unproven. The shared request is an app-wide opt-out that prevents the Git process from starting. Main follow-up: https://github.com/openai/codex/issues/20933#issuecomment-6761006007
Additional sanitized observation from Windows (2026-11-18, Asia/Jerusalem): a Codex-owned git add process appeared to remain active/stalled from approximately 19:05 local time. A simple filesystem read outside Codex completed in about 0.3 seconds, while Codex command/file-tool reads were hanging. No process was terminated, Codex was not restarted, and no repository, index, lockfile, or permission settings were changed. This is one observation only: no fresh reproduction, process tree, raw logs, or exit code was captured, so I cannot confirm whether it is the same failure mode as the automatic turn-diff captures described here. Please advise on safe diagnostics and whether this could be related.
I unpacked app.asar on the latest Windows build (26.1117.3838.0) to see why setting git-review-mode = "last-turn-only" in config.toml still did not stop the background snapshots, and found two issues in the bundle.
First, git-review-mode is gated behind a server-side Statsig check. In webview/assets/async/911644.2b086ab057.js (module DJRx, around offset 7622875):
let l="2333235660",
u=(0,r.un)(a.u,({get:e})=>{
let t=e(o.JW,l), n=e(o.M9);
return c((0,s.CN)(e,i.Ugj.reviewMode), t||n?.checkGate(l)===!0)
});
function c(e,t){return t?e:"full"}
If the account does not have gate 2333235660 enabled on the server, c(e, false) just forces the mode back to "full" and ignores config.toml. Because of that, eE (around offset 2496794) still triggers turn-diff-capture-start (operationSource: "turn_diff_analytics") on every turn whenever gate 586515394 is on.
Second, in .vite/build/worker.js, OR() (offset 1280490) calls IU() (offset 1222740) and IM() (offset 1220889) to snapshot the worktree (and similarly Rv() at offset 1134979). IU() creates a temp folder codex-index-* and sets GIT_INDEX_FILE to isolate the index, then removes that temp folder in finally.
The problem is that it only isolates GIT_INDEX_FILE, not GIT_OBJECT_DIRECTORY. When IM() runs git add -u and git add --sparse --pathspec-from-file=- across untracked files, all resulting blobs, trees, and packfiles are written straight into the repo's real .git/objects.
If there is any large untracked file in the worktree (above core.bigFileThreshold), git add streams a pack into .git/objects/pack/tmp_pack_*. Since the temp index is deleted after each turn, the file stays untracked in the real index, so Codex re-hashes and re-compresses the same large file on every single turn (in my case, 4 inspected leftover tmp_pack_* files totaling 2.68 GB all had the exact same 792 MB file as their first compressed entry). Whenever a turn finishes or times out and kills git.exe, finally only cleans up codex-index-* and leaves the half-written multi-GB tmp_pack_* orphaned in .git/objects/pack/ (which previously accumulated over 774 GiB on disk), along with 18,891 unreachable loose objects (1.96 GiB) from completed turns.
This should be pretty straightforward to fix on your side:
- When creating the
codex-index-*andcodex-git-index-*temp directories inIU()andRv(), also create a<temp>/objectsfolder and passGIT_OBJECT_DIRECTORY=<temp>/objectsplusGIT_ALTERNATE_OBJECT_DIRECTORIES=<repo>/.git/objectsto the git process. That way all temporary snapshot objects and abortedtmp_pack_*files stay inside the temp folder and get wiped automatically by the existingfinallycleanup without touching.git/objects. - Drop the
2333235660gate override inDJRxsogit-review-mode = "last-turn-only"(or an explicitoffsetting) actually works locally. - Skip untracked files larger than a reasonable size limit before passing pathspecs to
IM().