Skip to content

Windows Codex Desktop repeatedly leaks full-size Git LFS temp copies while refreshing a repo #34953

Description

@Jiuxiao-yunwai

What version of the Codex App are you using?

OpenAI.Codex 26.715.10079.0 (Windows x64)

Platform

  • Windows 10.0.26200.0 x64
  • Git 2.55.0.windows.2
  • Git LFS 3.7.1

Summary

While a local Git repository is open in Codex Desktop, repository-state/diff refreshes repeatedly invoke Git LFS processing for a large untracked file that matches an LFS attribute. Each refresh leaves another near-full-size file in .git/lfs/tmp, causing unbounded disk growth. In this incident, the directory grew past 42 GiB and resumed growing immediately after cleanup.

This is severe because merely keeping/using a Codex task open can fill the disk without the user requesting staging, committing, or any LFS operation.

Repository setup

.gitattributes contains:

*.db* filter=lfs diff=lfs merge=lfs -text

The working tree contains:

  • one tracked LFS database, about 551.6 MiB
  • one untracked backup database, also about 551.6 MiB, matching *.db*

The database content/path is not relevant; any sufficiently large untracked file matching an LFS rule should reproduce it.

Observed behavior

  1. With the Codex task active, git-lfs processes repeatedly appeared around repository refreshes/turns.
  2. .git/lfs/tmp accumulated files approximately the size of the database.
  3. Initial measurement: 90 temporary files, 42.046 GiB reclaimed after stopping git-lfs and deleting .git/lfs/tmp contents.
  4. The growth immediately resumed: 11 additional files consumed 5.13 GiB.
  5. A later five-second observation showed the temp directory grow from one partial file (538.3 MiB) to two files (556.4 MiB total).
  6. Adding only the untracked backup file to .git/info/exclude, stopping the active git-lfs process, and cleaning .git/lfs/tmp stopped the growth. A five-second recheck stayed at zero files.

git lfs prune --dry-run did not account for the problem: it reported only 288 MiB prunable because the tens of GiB were in .git/lfs/tmp, not normal LFS objects.

The tracked database's SHA-256 matched its indexed LFS OID, so it was not modified.

Steps to reproduce

  1. On Windows, create/open a Git repository in Codex Desktop.

  2. Add an LFS rule such as:

    *.db* filter=lfs diff=lfs merge=lfs -text
  3. Place a large untracked file such as backup.db in the working tree.

  4. Keep the local Codex task active and perform turns/tool calls that cause repository state/diff refreshes.

  5. Monitor .git/lfs/tmp and git-lfs processes.

Expected behavior

  • Background Git status/diff rendering must not run clean/LFS filters over large untracked files merely to display changes.
  • Cancellation or refresh replacement must terminate child processes cleanly and remove partial LFS temp files.
  • Repository polling should be debounced/bounded so it cannot consume disk without limit.
  • At minimum, Codex should detect and skip or cap large untracked files during snapshot/diff construction.

Actual behavior

Full-size or partial copies accumulate in .git/lfs/tmp on repeated refreshes until the disk is exhausted.

Workaround

Adding the large untracked file to .git/info/exclude stops the loop:

/data/path/backup.db

This is only a workaround; opening a repository containing any large, unignored file matching an LFS rule remains dangerous.

Related issues

This report narrows the failure to repeatable full-size files under .git/lfs/tmp caused by a large untracked file matching an LFS attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingperformancewindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions