Windows Codex Desktop Local mode: agent commands run from C:\ while integrated terminal uses project directory
What version of the Codex App are you using (From “About Codex” dialog)?
26.429.30905
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
In Codex Desktop on Windows, I opened a project with Add Project / Open Project and started a Local mode thread under that project.
The integrated terminal is correctly opened in the project directory:
D:\path\to\project
However, when I ask the Codex agent in the chat to run:
Get-Location
the agent command output returns:
C:\
So the integrated terminal and the agent-run command environment appear to have different current working directories.
This is confusing because the UI shows the thread is under the project and Local mode is selected, but agent-run PowerShell commands do not start in the project directory.
What steps can reproduce the bug?
Uploaded thread: 019ded06-0f99-7473-9e89-b2073dfee992
Steps to reproduce:
- Open Codex Desktop on Windows.
- Use Add Project / Open Project.
- Select a project folder, for example:
D:\path\to\project
- In the left sidebar, click the project entry and create a new thread from that project.
- Make sure the bottom mode selector shows Local mode.
- In the Codex chat, ask the agent to run:
Get-Location
- Observe that the chat/tool output returns:
C:\
- Open the integrated terminal in the same thread.
- Run:
Get-Location
- Observe that the integrated terminal returns the correct project path:
D:\path\to\project
The integrated terminal cwd is correct, but the agent command runner cwd is C:\.
What is the expected behavior?
In a Local mode project thread, agent-run PowerShell commands should start in the selected project directory, matching the integrated terminal cwd.
For this project, when the agent runs:
Get-Location
I expect it to return:
D:\path\to\project
instead of:
C:\
The integrated terminal and the agent command runner should use the same project working directory, or the agent command runner should inherit the Local project cwd.
Additional information
Screenshots show:
- The thread is under the project in the sidebar.
- Local mode is selected at the bottom of the composer.
- The integrated terminal returns the correct project path:
D:\path\to\project
- The agent-run chat command Get-Location returns:
C:\
Workaround:
If I explicitly prepend every agent command with:
Set-Location -LiteralPath "D:\path\to\project";
then commands work as expected. But this has to be done inside the same command invocation, because the next agent-run command may again start from C:\.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗