Codex Cloud stops recognizing Git remote and only references 'work' workspace

Open 💬 10 comments Opened Feb 22, 2026 by Ulamog101010

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?

  1. Open Codex Cloud (Web).
  2. Connect to a GitHub repository via OAuth.
  3. Work normally in a remote branch (e.g., codex/...).
  4. After some time, Codex stops referencing the remote branch.
  5. Running:

git branch --show-current
returns: work

  1. Running:

git remote -v
returns nothing.

  1. .git/config contains only [core] and no remote section.
  2. 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_

View original on GitHub ↗

10 Comments

GaranceRichard · 3 months ago

I can confirm this is still happening, and I now have a stronger repro signal.

Environment:

  • Codex Cloud (Web)
  • GitHub connected
  • Repository: GaranceRichard/monte-carlo-azure

What I did:

  • Started a new Cloud task
  • Explicitly selected main in the branch picker before sending the prompt
  • Asked Codex to only inspect Git publication readiness and not modify any file

Observed result:

  • git rev-parse --is-inside-work-tree => true
  • git branch --show-current => work
  • git status --short --branch => ## work
  • git remote -v => no output
  • git rev-parse --verify main => fails (fatal: Needed a single revision)
  • .git/config only contains [core] and no [remote "..."] section

So even when main is explicitly selected in the UI, the actual checkout is still:

  • on local branch work
  • with no GitHub remote
  • with main not resolvable locally

This makes the environment non-publishable and suggests the task checkout is not aligned with the selected branch in the UI.

Ulamog101010 · 3 months ago

Thank you for confirming this.

I’m seeing the exact same behavior in my environment:

  • branch becomes work
  • no origin remote
  • .git/config only 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.

Marcophono2 · 3 months ago

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.

newbelaravel · 3 months ago

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...

agape1225 · 2 months ago

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 branch command, 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.

Kotivskyi · 2 months ago

Any update on this? Is there a workaround?

Ulamog101010 · 2 months ago
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 work with 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.

ShawnHLD · 1 month ago

Can confirm this issue is still happening. Anybody else found a reliable workaround yet?

gumfactor · 21 days ago

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.

lorrib85-glitch · 9 days ago

Getting the same thing. Please share if anyone finds a fix.