What version of the Codex App are you using (From “About Codex” dialog)?
26.212.1823 (661)
What subscription do you have?
Business
What issue are you seeing?
When starting a new Codex thread in a Git worktree and selecting a specific branch/environment, the Codex app appears to always use the environment/configuration files from the main checkout (the currently checked-out branch), rather than from the branch selected for the new worktree.
For example, if my main project checkout is on a feature branch with different setup or environment files, and I create a new worktree targeting main, Codex still uses the files from the feature branch checkout. This can lead to incompatibilities when the environment/setup differs between branches.
I would expect Codex to load the environment/setup files from the branch/worktree that was selected when creating the new thread, not from whatever branch is currently checked out in the main repository.
What steps can reproduce the bug?
- Open a project in the Codex desktop app.
- In the main repository checkout, switch to a non-main branch (e.g. a feature branch) that has different environment/setup files.
- Create a new Codex thread using the “new thread in Git worktree” workflow.
- Select the
main branch (or another branch different from the one currently checked out in the main repo) as the target environment/branch.
- Start the thread.
Observed: Codex still uses the environment/setup files from the main checkout’s currently selected branch, not from the selected worktree branch.
Reproducibility: Happens consistently whenever the main checkout is not on the same branch as the newly created worktree.
What is the expected behavior?
Codex should use the environment/setup/configuration files from the branch/worktree that is selected when creating the new thread.
If I create a new worktree targeting main, Codex should load the environment as it exists on main, regardless of which branch is currently checked out in the main project directory.
Additional information
This seems related to how Codex resolves environment/config files when initializing a new worktree-based thread. It may be incorrectly referencing the main checkout directory instead of the newly created worktree directory.
This can be problematic in workflows where branches have different dependencies or setup requirements.
What version of the Codex App are you using (From “About Codex” dialog)?
26.212.1823 (661)
What subscription do you have?
Business
What issue are you seeing?
When starting a new Codex thread in a Git worktree and selecting a specific branch/environment, the Codex app appears to always use the environment/configuration files from the main checkout (the currently checked-out branch), rather than from the branch selected for the new worktree.
For example, if my main project checkout is on a feature branch with different setup or environment files, and I create a new worktree targeting
main, Codex still uses the files from the feature branch checkout. This can lead to incompatibilities when the environment/setup differs between branches.I would expect Codex to load the environment/setup files from the branch/worktree that was selected when creating the new thread, not from whatever branch is currently checked out in the main repository.
What steps can reproduce the bug?
mainbranch (or another branch different from the one currently checked out in the main repo) as the target environment/branch.Observed: Codex still uses the environment/setup files from the main checkout’s currently selected branch, not from the selected worktree branch.
Reproducibility: Happens consistently whenever the main checkout is not on the same branch as the newly created worktree.
What is the expected behavior?
Codex should use the environment/setup/configuration files from the branch/worktree that is selected when creating the new thread.
If I create a new worktree targeting
main, Codex should load the environment as it exists onmain, regardless of which branch is currently checked out in the main project directory.Additional information
This seems related to how Codex resolves environment/config files when initializing a new worktree-based thread. It may be incorrectly referencing the main checkout directory instead of the newly created worktree directory.
This can be problematic in workflows where branches have different dependencies or setup requirements.