Codex Desktop: “Stage all” fails in every repository

Open 💬 2 comments Opened Apr 4, 2026 by daberni

What version of the Codex App are you using (From “About Codex” dialog)?

Codex Desktop 26.325.31654

What subscription do you have?

ChatGPT

What platform is your computer?

macOS 26.3.1 (Apple Silicon, arm64)

What issue are you seeing?

The Codex Desktop “Stage all” action fails with the message:

Failed to stage

This is happening across repositories, not just one repository.

During investigation I found two likely related app-side problems:

  1. Codex Desktop was trying to resolve Git state for stale, deleted workspaces/worktrees from earlier sessions.
  2. Even after cleaning those stale references enough to remove bad handoff suggestions, “Stage all” still fails.

At one point I observed a concrete backend staging failure:

  • Codex ran: git apply --3way --cached .../patch.diff
  • that failed with exit code 128

After further cleanup and app restarts, the UI still showed “Failed to stage”, but the newest local logs no longer contained a fresh matching Git failure. So the app now appears to fail before emitting a useful backend error, or it is surfacing a stale/generic UI error.

What steps can reproduce the bug?

I do not have a guaranteed minimal repro yet, but this is the pattern I observed:

  1. Use Codex Desktop over time across multiple repositories and sessions.
  2. Use the Git UI and click “Stage all”.
  3. The app shows “Failed to stage”.

Observed behavior:

  • This happens across repositories, not just one.
  • Normal Git in the terminal still works.
  • Manual git add works.
  • Codex Desktop “Stage all” does not.

I also found stale deleted workspaces that Codex was still trying to inspect, for example:

  • /Users/bd/.codex/worktrees/805e/<redacted>
  • /Users/bd/.codex/worktrees/86c0/<redacted>
  • /private/tmp/<redacted>-22fd

Codex was actively running Git commands against those nonexistent paths, such as:

  • git status --porcelain=v1 -z
  • git rev-parse --abbrev-ref HEAD
  • git remote

with failures like:

  • ENOENT: path does not exist
  • failureReason=waitFailed

What is the expected behavior?

“Stage all” should stage all current changes successfully, or at least display a concrete actionable error.

Codex Desktop should also ignore stale historical workspaces instead of trying to run Git commands against deleted paths.

Additional information

Things already tried:

  1. Inspected Codex logs under:
  • ~/Library/Logs/com.openai.codex
  1. Inspected Codex local state under:
  • ~/.codex/sessions
  • ~/.codex/archived_sessions
  • ~/Library/Application Support/Codex
  1. Found stale workspace/worktree references in session history and runtime behavior.
  1. Backed up and patched specific session files to replace stale deleted paths with real current repo paths.
  1. Restarted Codex Desktop multiple times.
  1. Recreated one missing worktree as a real Git worktree:
  • /Users/bd/.codex/worktrees/805e/<redacted>
  1. Confirmed that this improved at least one stale-workspace symptom.
  1. Cleaned a stale temporary verification-worktree reference enough that it disappeared from handoff suggestions.
  1. Verified normal Git still works in terminal:
  • git status
  • git add
  1. Confirmed that “Stage all” still fails in the desktop UI across repositories.

Other notes:

  • There were no useful crash reports in macOS DiagnosticReports.
  • Local Sentry/app-support files did not reveal a clearer staging exception.
  • macOS unified logs also did not reveal a useful repo-agnostic cause.

So this now looks like a Codex Desktop app bug, likely separate from or only partially related to the stale-workspace issue.

View original on GitHub ↗

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