Codex desktop side-panel terminal opens base checkout instead of active worktree
With Codex, I can easily create new thread in dedicated worktree, but when I'm opening the terminal in the side panel, it starts on root / base, not in the worktree. This is puzzling, because we can't easily reproduce issues then, all the files we are editing are in the worktree and the path is not easy to get
Below is LLM generated
LLM generated information
What version of the Codex App are you using (From “About Codex” dialog)?
Codex App 26.519.31651 (CFBundleVersion 3017)
Bundled Codex CLI reported by /Applications/Codex.app/Contents/Resources/codex --version:
codex-cli 0.133.0-alpha.1
What subscription do you have?
Not available to the agent from the shell. The reporter can add this if needed.
What platform is your computer?
Darwin 24.6.0 arm64 arm
What issue are you seeing?
The Codex Desktop side-panel terminal opens in the base/local checkout instead of the active Codex-managed worktree used by the current thread/agent.
In this session, the agent/thread working directory is:
/Users/valentindemange/.codex/worktrees/a0ac/dashdoc-1
But when opening the terminal from the Codex app side panel, it opens in:
/Users/valentindemange/Repos/dashdoc/dashdoc-1
Those are different git worktrees. This makes the terminal risky and much less useful, because commands typed by the human run in a different checkout than the one the agent is reading, editing, and testing.
Impact:
- The terminal is not aligned with the agent/thread execution context.
- Manual commands can inspect or modify the wrong checkout.
- Debugging agent commands is harder because copy/pasting commands from the conversation runs them somewhere else.
- It is easy to accidentally start services, run tests, or change files in the base checkout while the agent is operating in the Codex-managed worktree.
What steps can reproduce the bug?
- Start or open a Codex Desktop thread that is running in a Codex-managed worktree.
- In the agent/thread, check the working directory. In this session it is:
``bash``
pwd
# /Users/valentindemange/.codex/worktrees/a0ac/dashdoc-1
- Open the Codex app side-panel terminal for the same thread.
- Run
pwdin that terminal. - Observe that the side-panel terminal opens in the base checkout instead of the thread worktree:
``bash``
pwd
# /Users/valentindemange/Repos/dashdoc/dashdoc-1
Session/context details:
- The repository has both a normal checkout and Codex-managed worktrees.
- The current thread is clearly operating from
/Users/valentindemange/.codex/worktrees/a0ac/dashdoc-1. - The side-panel terminal opens in
/Users/valentindemange/Repos/dashdoc/dashdoc-1.
What is the expected behavior?
For a given Codex Desktop thread, the side-panel terminal should open in the same working directory as the agent/thread execution context.
Expected terminal cwd:
/Users/valentindemange/.codex/worktrees/a0ac/dashdoc-1
At minimum, the UI should make the mismatch explicit and offer a clear action such as “Open terminal in active worktree”.
The important invariant is: one thread should have one obvious active workspace path for the agent and the human terminal, unless the app explicitly communicates otherwise.
Additional information
This seems related to, but more specific than, existing worktree/context issues:
- https://github.com/openai/codex/issues/16531
- https://github.com/openai/codex/issues/19627
- https://github.com/openai/codex/issues/20934
- https://github.com/openai/codex/issues/27554
Those issues cover broader worktree sync, branch scoping, stale workspace paths, or context loss. This report is specifically about the Codex Desktop side-panel terminal opening in a different checkout than the active agent/thread worktree.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗