Branch selection in Codex Desktop should be scoped to the selected git worktree/project root
What version of the Codex App are you using (From “About Codex” dialog)?
0.124.0-alpha.2
What subscription do you have?
ChatGPT Business
What platform is your computer?
Darwin 24.1.0 arm64 arm
What issue are you seeing?
Codex Desktop does not clearly isolate branch selection by git worktree/project root.
I use Codex Desktop as a single developer working on multiple feature requests in parallel. Each feature request has its own git branch and git worktree. Because Codex tasks can take time to inspect code, run tests, build services, or resolve merge conflicts, I often need multiple Codex conversations running in parallel.
In this workflow, the Desktop app requires selecting a branch when starting a conversation. That branch selection appears to be scoped to the repository/main checkout rather than clearly scoped to the selected physical worktree/project root.
This makes parallel Codex conversations fragile. A conversation intended for one task/worktree can affect or confuse another workspace, especially the main checkout. In practice this leads to accidental branch switching, wrong-worktree edits, and repeated manual checks to recover the correct state.
What steps can reproduce the bug?
- Create a repo with two feature branches and two git worktrees.
Run these commands:
mkdir /tmp/codex-worktree-demo
cd /tmp/codex-worktree-demo
git init
echo "main" > file.txt
git add file.txt
git commit -m "init"
git checkout -b feature-a
echo "feature-a" > feature-a.txt
git add feature-a.txt
git commit -m "feature a"
git checkout main
git checkout -b feature-b
echo "feature-b" > feature-b.txt
git add feature-b.txt
git commit -m "feature b"
git checkout main
git worktree add /tmp/codex-worktree-demo.a feature-a
git worktree add /tmp/codex-worktree-demo.b feature-b
- Open
/tmp/codex-worktree-demoin Codex Desktop.
- Open
/tmp/codex-worktree-demo.aand/tmp/codex-worktree-demo.bas separate Desktop projects or conversations.
- Start a conversation for
/tmp/codex-worktree-demo.a. When Codex Desktop requires selecting a branch, selectfeature-a.
- Start another conversation for
/tmp/codex-worktree-demo.b. When Codex Desktop requires selecting a branch, selectfeature-b.
- Check the active branches and worktrees.
Run:
git -C /tmp/codex-worktree-demo branch --show-current
git -C /tmp/codex-worktree-demo.a branch --show-current
git -C /tmp/codex-worktree-demo.b branch --show-current
git -C /tmp/codex-worktree-demo worktree list
Actual behavior: branch selection in Codex Desktop is not clearly scoped to the selected physical worktree/project root. In multi-worktree usage, it can affect or confuse the main checkout or another worktree-backed conversation, which makes parallel Codex tasks fragile.
Session id: not applicable.
Token/context usage: not relevant.
What is the expected behavior?
Codex Desktop should treat each physical git worktree path as an independent project root.
Expected behavior:
- One Codex Desktop conversation is bound to one selected project root/worktree.
- Branch selection is scoped only to that selected worktree.
- Selecting a branch for one conversation must not affect the main checkout or another worktree-backed conversation.
- Branch switching should behave like:
git -C <selected-worktree-path> checkout <branch>. - The UI should show the physical project root, for example the result of
git rev-parse --show-toplevel. - If a branch action would affect a directory other than the selected project root, Codex Desktop should warn or block it.
Desired workflow:
- One feature request = one git worktree.
- One Codex Desktop conversation = one worktree/project root.
- Branch selection = scoped only to that worktree.
Additional information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗