What version of the Codex App are you using (From "About Codex" dialog)?
26.623.81905 (4598)
What subscription do you have?
Pro
What platform is your computer?
Darwin 24.6.0 arm64 arm
What issue are you seeing?
Codex App shows a phantom branch in the branch selector when the repository's remote default branch contains a slash.
In this repo, the real default/current branch is:
But Codex App shows both:
personal/local-clients
local-clients
local-clients is not a real local or remote branch. It appears to be derived incorrectly from the remote HEAD ref by taking only the last path segment.
Git evidence from the affected repo:
git rev-parse --abbrev-ref HEAD
# personal/local-clients
git symbolic-ref --quiet refs/remotes/origin/HEAD
# refs/remotes/origin/personal/local-clients
git remote show origin
# HEAD branch: personal/local-clients
git for-each-ref refs/heads '--format=%(refname:short)'
# personal/local-clients
These refs do not exist:
git rev-parse --verify refs/heads/local-clients
# fatal: Needed a single revision
git rev-parse --verify refs/remotes/origin/local-clients
# fatal: Needed a single revision
So the local-clients entry is a Codex App UI/generated branch entry, not a Git branch.
I also inspected the packaged Codex App source for the installed app. In the packaged worker bundle, the locally-known default branch resolver appears to run:
git symbolic-ref --quiet refs/remotes/${remote}/HEAD
and then parse stdout like this:
let r = stdout.split("/");
return r[r.length - 1] ?? null;
For this repository, stdout is:
refs/remotes/origin/personal/local-clients
That parsing returns:
but the correct remote default branch is:
The parser should remove the refs/remotes/${remote}/ prefix, or use git symbolic-ref --short refs/remotes/${remote}/HEAD and then remove the ${remote}/ prefix. Taking only the final slash-delimited segment loses valid branch path components.
What steps can reproduce the bug?
- Create or use a GitHub repository whose default branch contains a slash, for example:
- Clone the repository locally and ensure
origin/HEAD points to that branch:
git symbolic-ref --quiet refs/remotes/origin/HEAD
# refs/remotes/origin/personal/local-clients
-
Open the repository in Codex App.
-
Open the branch selector / starting branch selector.
-
Observe that Codex App lists both the real branch and a phantom basename-only branch:
personal/local-clients
local-clients
- Verify that
local-clients is not a real branch:
git show-ref | grep local-clients
# only refs/heads/personal/local-clients
# only refs/remotes/origin/personal/local-clients
What is the expected behavior?
Codex App should show only the real branch:
It should not synthesize or display:
Branch names containing / are valid Git branch names and should be preserved when resolving the remote default branch.
Additional information
This looks related to default branch resolution, not general Git state. The current branch, recent branches, and Git refs are correct. The incorrect entry appears to come from parsing refs/remotes/origin/HEAD by splitting on / and taking the final segment.
This only reproduces when the remote default branch name itself contains /, so repos using simple default branch names like main or master would not expose the bug.
What version of the Codex App are you using (From "About Codex" dialog)?
26.623.81905 (4598)
What subscription do you have?
Pro
What platform is your computer?
Darwin 24.6.0 arm64 arm
What issue are you seeing?
Codex App shows a phantom branch in the branch selector when the repository's remote default branch contains a slash.
In this repo, the real default/current branch is:
But Codex App shows both:
local-clientsis not a real local or remote branch. It appears to be derived incorrectly from the remote HEAD ref by taking only the last path segment.Git evidence from the affected repo:
These refs do not exist:
So the
local-clientsentry is a Codex App UI/generated branch entry, not a Git branch.I also inspected the packaged Codex App source for the installed app. In the packaged worker bundle, the locally-known default branch resolver appears to run:
and then parse stdout like this:
For this repository, stdout is:
That parsing returns:
but the correct remote default branch is:
The parser should remove the
refs/remotes/${remote}/prefix, or usegit symbolic-ref --short refs/remotes/${remote}/HEADand then remove the${remote}/prefix. Taking only the final slash-delimited segment loses valid branch path components.What steps can reproduce the bug?
origin/HEADpoints to that branch:git symbolic-ref --quiet refs/remotes/origin/HEAD # refs/remotes/origin/personal/local-clientsOpen the repository in Codex App.
Open the branch selector / starting branch selector.
Observe that Codex App lists both the real branch and a phantom basename-only branch:
local-clientsis not a real branch:What is the expected behavior?
Codex App should show only the real branch:
It should not synthesize or display:
Branch names containing
/are valid Git branch names and should be preserved when resolving the remote default branch.Additional information
This looks related to default branch resolution, not general Git state. The current branch, recent branches, and Git refs are correct. The incorrect entry appears to come from parsing
refs/remotes/origin/HEADby splitting on/and taking the final segment.This only reproduces when the remote default branch name itself contains
/, so repos using simple default branch names likemainormasterwould not expose the bug.