LFS, CODEX web interface Git History corruption. willing to commit autonomously, but unable to push lfs content,

Resolved 💬 2 comments Opened Jun 14, 2025 by sangderenard Closed Nov 2, 2025

What version of Codex is running?

ChatGPT integrated version

Which model were you using?

ChatGPT integrated version

What platform is your computer?

Win 10 64

What steps can reproduce the bug?

If the web agent handles lfs installation or handles lfs files, there is a high probability of this occurring

What is the expected behavior?

One would expect the web agent to have safeguards to prevent establishing states that are almost unrecoverable and damage branch history.

What do you see instead?

large files end up tracked, but also random small json files end up tracked, and anything the web agent would push that is lfs tracked never gets lfs pushed, leaving broken pointers and a broken commit that poisons the commit history with LFS files that were never there to begin with, because again, the web agent does not appear to be able to push lfs tracked files.

Additional information

This is a mostly accurate summary from GPT, though it has the repo locations where scripts ran confused. It took a great deal of time and back and forth to diagnose and fix, so I thought it useful to ask for a summary.

-----

<html>
<body>
<!--StartFragment--><html><head></head><body><h2>Incident Report</h2>
<h3>Autonomous-Agent Interaction with Git &amp; Git LFS — “Codex × Wheelhouse” Case Study</h3>
<hr>
<h3>1. Background</h3>
<ul>
<li>
<p><strong>Repository topology</strong></p>
<ul>
<li>
<p><em>speaktome</em> (main project)</p>
</li>
<li>
<p><em>wheelhouse</em> (aux repo holding pre-built <code inline="">.whl</code> bundles)</p>
</li>
</ul>
</li>
<li>
<p><strong>Agent</strong> – a Codex-style automation that executes PowerShell/Bash build scripts without human confirmation.</p>
</li>
<li>
<p><strong>Large-file policy</strong> – Git LFS was acceptable only for <em>true</em> large binaries, <strong>never</strong> for JSON or small wheels (&lt;100 kB).</p>
</li>
</ul>
<hr>
<h3>2. Trigger Script</h3>
<p>The agent executed <strong><code inline="">build-wheelhouse.sh</code></strong> </p>
<ul>
<li>
<p>Downloads wheels for Windows &amp; manylinux (↗ <code inline="">pip download … --platform …</code>)</p>
</li>
<li>
<p>Writes them under <code inline="">wheelhouse/wheels/{linux,windows}/…</code></p>
</li>
<li>
<p>Finally <strong>installs “LFS guard hooks”</strong> <em>if</em> it finds the <code inline="">lfsavoider</code> sub-module — but the guard ran <strong>after</strong> files had already been added to the index.</p>
</li>
<li>
<p>Because <code inline="">.gitattributes</code> was still carrying</p>
<pre><code>*.whl filter=lfs diff=lfs merge=lfs -text
</code></pre>
<p>every wheel became an <strong>LFS pointer</strong>, even the 25 KB <code inline="">colorama</code> wheels.</p>
</li>
</ul>
<hr>
<h3>3. Failure Cascade</h3>

Time | Autonomous Action | Hidden Git/LFS Mechanism | Visible Outcome
-- | -- | -- | --
T₀ | Agent runs build-wheelhouse | git add wheelhouse/…whl → Git stores pointer stubs instead of real wheels | Commit appears tiny; push seems fine
T₁ | Human clones repo elsewhere | git lfs smudge contacts GitHub LFS | 404 error: object ID not on server
T₂ | Attempts to pull future updates | Every checkout touches the bad stubs | Developers blocked by “smudge filter lfs failed”
T₃ | Manual deletions of .whl paths | Index clean, but old commit with pointers still in branch | git push invokes pre-push hook → tries to upload missing blob → fails
T₄ | “Nuclear” historical rewrite | Only option: git filter-repo --path wheelhouse/wheels --invert-paths + force-push | Repo finally usable

<hr>
<h3>7. Conclusion</h3>
<p>This episode exemplifies the <strong>high coupling</strong> between autonomous build agents, Git’s filter architecture, and GitHub’s LFS enforcement. A single misplaced <code inline="">.gitattributes</code> line turned harmless 25 KB wheels into long-tailed poison across the DAG.<br>
Scientific lesson: in distributed VCS, <strong>consistency constraints propagate historically</strong>, so remediation must consider the <em>entire reachable state space</em>, not just the tip.<br>
Engineering lesson: bake LFS policy checks into the agent’s critical path, and treat history-rewriting tools (<code inline="">git filter-repo</code>) as first-line fixes rather than last-ditch nukes.</p></body></html><!--EndFragment-->
</body>
</html>

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗