Codex Cloud stops recognizing Git remote and only references 'work' workspace
What issue are you seeing?
Description:
Codex Cloud suddenly stopped recognizing the Git remote configuration of my repository and began referencing only a local 'work' branch.
This did NOT start after a disconnect.
The issue appeared while working normally in the same environment.
Expected behavior:
- The previously checked out branch (e.g., codex/make-world.range.extend.fixture.test.ts-hermetic) should persist.
- The Git remote 'origin' should remain present in .git/config.
- git remote -v should list the GitHub repository.
Actual behavior:
- git branch shows: work
- git remote -v shows no output
- .git/config contains only the [core] section
- Remote configuration disappears
Attempts to fix:
- Refreshing the browser
- Reconnecting
- Saving the environment
- Logging out and back in
None of these restored the remote configuration.
Workaround:
Manually running:
git remote add origin https://github.com/...
git fetch origin
git checkout -B <branch> origin/<branch>
Restores the environment temporarily.
Environment:
Codex Cloud (Web)
GitHub OAuth connected
Occurs persistently once the issue appears.
What steps can reproduce the bug?
- Open Codex Cloud (Web).
- Connect to a GitHub repository via OAuth.
- Work normally in a remote branch (e.g., codex/...).
- After some time, Codex stops referencing the remote branch.
- Running:
git branch --show-current
returns: work
- Running:
git remote -v
returns nothing.
- .git/config contains only [core] and no remote section.
- Refreshing, reconnecting, and saving the environment does not restore the remote.
What is the expected behavior?
Codex Cloud should persist:
- The currently checked out branch
- The Git remote configuration (origin)
- The .git/config remote section
Reopening or refreshing the environment should not remove the Git remote or switch to a local 'work' branch.
Additional information
_No response_
10 Comments
I can confirm this is still happening, and I now have a stronger repro signal.
Environment:
What I did:
mainin the branch picker before sending the promptObserved result:
git rev-parse --is-inside-work-tree=>truegit branch --show-current=>workgit status --short --branch=>## workgit remote -v=> no outputgit rev-parse --verify main=> fails (fatal: Needed a single revision).git/configonly contains[core]and no[remote "..."]sectionSo even when
mainis explicitly selected in the UI, the actual checkout is still:workmainnot resolvable locallyThis makes the environment non-publishable and suggests the task checkout is not aligned with the selected branch in the UI.
Thank you for confirming this.
I’m seeing the exact same behavior in my environment:
workoriginremote.git/configonly contains[core]It also happens regardless of the repository, which suggests this is not repo-specific but related to the Codex Cloud workspace or checkout process.
Same here. Codex becomes useless for me with this buggy behaviour. (aside from connection loss, doing the whole job again after re-connection although only the git push failed and some things more) Only as Claude had some issues yesterday I switched temporary to Codex. Not I remember why I switched to Claude in the past.
I confirm it happens. I have codex and repo linked via connector
<img width="994" height="340" alt="Image" src="https://github.com/user-attachments/assets/6d5053c2-4d8d-4f31-ba16-58cab49c67b0" />
However, when I ask codex to fix an issue, it can't. A very strange behavior appears.
The agent starts fixing something (it has acces to code in the repo) but that fix does not have to do anything with the issue. When I confronted, it admitted it could not see the issues and just guessed /facepalm.
I also asked to create a branch and says it finds 403...
I also discovered this problem while using Codex in Slack.
After connecting to the github repository, a new cloud environment was created and Internet settings were also allowed, but only the work branch can be viewed. When I checked with the
git branchcommand, I confirmed that only the work branch appears.It seems that codex is blocking the connection to the remote repository. I hope that problem is resolved quickly.
Any update on this? Is there a workaround?
No official update yet.
Initially, I thought manually restoring the Git remote could temporarily recover the environment:
git remote add origin <repo-url>
git fetch origin
git checkout -B <branch> origin/<branch>
These steps do appear to succeed at the Git level (the branch can be checked out and looks correct).
However, in practice I haven’t been able to actually use the environment in that restored state. The workspace quickly reverts back to
workwith no remote after reconnecting or reopening, so it is not stable or usable.So I would not consider this a reliable workaround—only a momentary recovery that does not persist.
This seems to be an issue on the Codex Cloud side rather than something repository-specific.
Can confirm this issue is still happening. Anybody else found a reliable workaround yet?
So frustrating!
I tried adding git tokens to environment secrets, installing gh explicitly during startup script - nothing works, OpenAI is intentionally stripping the ability to view any GitHub branches.
Entirely useless this way.
Getting the same thing. Please share if anyone finds a fix.