What version of the Codex App are you using (From “About Codex” dialog)?
26.623.81905 (4598)
What subscription do you have?
Not available from this agent/tool context; the user can edit this field if needed.
What platform is your computer?
Darwin 25.5.0 arm64 arm
Git version: git version 2.54.0
What issue are you seeing?
In a Codex App worktree session that starts detached, manually switching the worktree onto a branch in the terminal succeeds, and subsequent agent/terminal commands report the correct branch. However, the Codex App Environment UI can remain stale and continue presenting detached-worktree actions/state such as Create branch.
In the tested session, the first branch check reported detached HEAD:
Current branch: detached HEAD (no branch)
Current commit: 75dd6a93b400478703c37e451dddf5de7154d948
Then the terminal workaround was run:
git -C /Users/dpearson/.codex/worktrees/f153/ios-options-wheel-tracker switch codex/full-sync-gate-state
Git then reported the correct named branch:
## codex/full-sync-gate-state...origin/codex/full-sync-gate-state
codex/full-sync-gate-state
A follow-up in the Codex thread also reported:
I'm on codex/full-sync-gate-state, tracking origin/codex/full-sync-gate-state.
Despite that, the Environment UI still appeared to show stale worktree/detached state and offered Create branch instead of reflecting the branch-attached state.
What steps can reproduce the bug?
- Create or open a Codex App worktree session that is in detached HEAD.
- Verify the detached state:
git status --short --branch
git symbolic-ref --short -q HEAD || echo HEAD
Example output:
- From the terminal inside the same worktree, switch onto a branch that is not checked out by another worktree:
git switch codex/full-sync-gate-state
- Verify Git is now branch-attached:
git status --short --branch
git branch --show-current
Example output:
## codex/full-sync-gate-state...origin/codex/full-sync-gate-state
codex/full-sync-gate-state
- Ask the Codex thread what branch it is on; it reports the named branch.
- Open the Codex App Environment menu / upper-left worktree UI.
- Observe that the UI still reflects the earlier detached state or offers actions intended for detached HEAD, such as Create branch.
What is the expected behavior?
The Environment UI should refresh when the active worktree's .git/HEAD changes, or provide a manual refresh action. After git switch <branch> succeeds, the UI should show the named branch and branch-appropriate actions.
Additional information
This is related to #10704 and #30954, but it is a separate UI refresh/staleness problem. #30954 covers worktree creation semantics. This issue covers the UI not reflecting a successful branch switch inside an existing Codex worktree.
What version of the Codex App are you using (From “About Codex” dialog)?
26.623.81905 (4598)
What subscription do you have?
Not available from this agent/tool context; the user can edit this field if needed.
What platform is your computer?
Darwin 25.5.0 arm64 armGit version:
git version 2.54.0What issue are you seeing?
In a Codex App worktree session that starts detached, manually switching the worktree onto a branch in the terminal succeeds, and subsequent agent/terminal commands report the correct branch. However, the Codex App Environment UI can remain stale and continue presenting detached-worktree actions/state such as Create branch.
In the tested session, the first branch check reported detached HEAD:
Then the terminal workaround was run:
Git then reported the correct named branch:
A follow-up in the Codex thread also reported:
Despite that, the Environment UI still appeared to show stale worktree/detached state and offered Create branch instead of reflecting the branch-attached state.
What steps can reproduce the bug?
Example output:
Example output:
What is the expected behavior?
The Environment UI should refresh when the active worktree's
.git/HEADchanges, or provide a manual refresh action. Aftergit switch <branch>succeeds, the UI should show the named branch and branch-appropriate actions.Additional information
This is related to #10704 and #30954, but it is a separate UI refresh/staleness problem. #30954 covers worktree creation semantics. This issue covers the UI not reflecting a successful branch switch inside an existing Codex worktree.