openai / openai/codex

Windows: overlong Codex checkpoint ref paths break git fetch

Open
#39,248 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

app bug session windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

Codex Desktop on Windows creates loose internal checkpoint refs whose paths can exceed the Windows path limit. Once that happens, ordinary Git operations such as git fetch origin develop --prune fail because Git reads the ref as an invalid zero SHA.

Environment

  • Codex Desktop for Windows
  • Windows NT 10.0.26200.0
  • Git 2.54.0.windows.1
  • PowerShell 7.6.4

Ref layout

The failing refs use this shape:

.git/refs/codex/turn-diffs/checkpoints/<64-hex>/<64-hex>/<timestamp>/<uuid>

Two such refs were present. Their leaf files each contained a valid 40-character SHA.

Actual behavior

fatal: bad object refs/codex/turn-diffs/checkpoints/<redacted>
error: <remote> did not send all necessary objects

git fsck --full --no-dangling explained the underlying failure:

warning: failed to stat '.git/refs/codex/turn-diffs/checkpoints/<redacted>': Filename too long
error: refs/codex/turn-diffs/checkpoints/<redacted>: invalid sha1 pointer 0000000000000000000000000000000000000000

The refs were not logically corrupt:

  • reading each loose ref file through the Windows filesystem returned a valid SHA;
  • git cat-file -e <sha>^{object} succeeded;
  • git rev-list --objects --missing=print <sha> reported no missing objects.

Limiting fetch negotiation with --negotiation-tip=origin/develop or fetch.negotiationAlgorithm=noop did not help, because Git still validates the overlong local ref path.

Workaround that confirmed the cause

Moving only the .git/refs/codex/turn-diffs/checkpoints directory to a short, recoverable path outside .git/refs immediately allowed the same git fetch origin develop --prune command to succeed. No normal branches, tags, or Git objects were changed.

Expected behavior

Codex internal checkpoint storage should not create Git ref paths that exceed Windows path limits. Possible approaches include a flatter hashed layout, packed refs, shorter identifiers, or long-path-aware filesystem handling.

Reproduction outline

  1. Use Codex Desktop on Windows in a repository until internal turn-diff checkpoint refs are created.
  2. Observe nested loose refs under .git/refs/codex/turn-diffs/checkpoints/.
  3. Once the complete path exceeds the Windows limit, run git fetch origin develop --prune.
  4. Fetch fails with bad object refs/codex/turn-diffs/checkpoints/...; git fsck reports Filename too long.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the Windows failure with the checkpoint refs under .git/refs/codex/turn-diffs/checkpoints/, then inspect where those refs are created; done means checkpoint storage no longer creates overlong paths and git fetch origin develop --prune succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.