You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows app appears unstable around branch/worktree state #16290
What version of the Codex App are you using (From “About Codex” dialog)?
26.325.31654
What subscription do you have?
Pro
What platform is your computer?
No response
What issue are you seeing?
The Windows app appears unstable around branch/worktree state. I was switched from the task branch to main, could not switch back, and had to migrate to a new branch. After that, generated diffs in a large monolith file became hard to trust because duplicate/conflicting changes may have been introduced by branch/context instability rather than intentional edits. Separately, menu popups are unreliable and clip off-screen, which makes recovery harder. During coding, I’m seeing repeated PowerShell runtime errors including null dereference on .Trim() and malformed \ command execution. Combined with branch/worktree instability, this makes generated diffs in large files hard to trust because partial or corrupted edits may be introduced by execution failures rather than intended code changes.
What steps can reproduce the bug?
Open Codex desktop app on Windows.
Load a repo with an existing feature branch
Start a task and allow Codex to operate on that branch.
Continue working for several iterations (code generation, apply patches, run tests).
Observe branch context in the app.
Attempt to switch back to the original task branch after context changes.
What is the expected behavior?
Stable branch context
Reliable menu interactions
Clean command execution
Small, surgical diffs aligned to task scope
Codex creates its branch from a snapshot of main at task start. If main moves forward before Codex finishes (even a README edit or an auto-generated commit), the PR lands with conflicts — even though you never touched those files. It's a race condition between Codex's branch base and the current main.
Workaround that worked for me
I created a GitHub Actions workflow that auto-resolves conflicts by merging main into the Codex branch with -X theirs (keeping Codex's changes):
Activity
github-actions commentedon Mar 31, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
DisabledAbel commentedon Mar 31, 2026
Why this happens
Codex creates its branch from a snapshot of
mainat task start. Ifmainmoves forward before Codex finishes (even a README edit or an auto-generated commit), the PR lands with conflicts — even though you never touched those files. It's a race condition between Codex's branch base and the currentmain.Workaround that worked for me
I created a GitHub Actions workflow that auto-resolves conflicts by merging
maininto the Codex branch with-X theirs(keeping Codex's changes):Key things that tripped me up:
permissions: contents: writeis required or the push silently fails with 403git configmust come before the merge step, not just before the commitactions/checkout@v5to avoid the Node 20 deprecation warningWould love to see Codex handle this natively — maybe by rebasing its branch on
mainright before opening the PR.