Windows Codex Desktop local action executes but closes/resets chat and leaves PowerShell at >> prompt
What happened?
On Windows Codex Desktop, running a configured local environment action executes the command, but the active chat closes/resets as if a new chat was being created.
This happens even when the action command only starts an external terminal wrapper. The external terminal opens and the command runs, but Codex Desktop still closes/resets the active chat.
The integrated terminal is left at a PowerShell continuation prompt (>>) after the action is invoked.
Environment
- OS: Windows
- Codex Desktop package:
OpenAI.Codex_26.602.4764.0_x64__2p2nqsd0c76g0 - Workspace type: Windows local filesystem
- Shell shown by the action terminal: Windows PowerShell
- Project local environment file:
.codex/environments/environment.toml
Reproduction
Configure an action like this:
[[actions]]
name = "Test : External Terminal"
icon = "run"
command = "scripts\\codex-external-test.cmd"
With this wrapper:
@echo off
setlocal
pushd "%~dp0\.." || exit /b 1
start "Codex External Test" powershell -NoExit -NoProfile -Command "Write-Host 'Codex external terminal action test'; npm run test"
popd
Then click the action in Codex Desktop.
Expected behavior
The configured action should run and the current Codex chat/thread should remain open.
Actual behavior
- The external terminal opens.
- The command runs successfully.
- Codex Desktop closes/resets the current chat UI.
- The integrated terminal shows the action invocation and then gets left at
>>:
PS <workspace>> Set-Location -LiteralPath '<workspace>/.'; scripts\codex-external-test.cmd
PS <workspace>>
>>
If the action is changed to append ; exit, the chat still closes/resets, but the terminal disappears quickly and the command is not visible in the integrated terminal.
Local investigation
Manual execution of npm run test from the Codex shell works and does not close the chat. The test command exits successfully.
The failure appears tied to the Codex Desktop local action runner / integrated terminal handling on Windows, not to the npm command, TOML parsing, or the wrapper script.
Inspection of the installed Desktop package shows local environment/action UI assets in app.asar, and the package includes node-pty / ConPTY helpers such as conpty_console_list_agent. This looks related to other Windows terminal/action issues around node-pty and AttachConsole failed.
Related issues
- #25272
- #19629
- #21731
- #25372
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks. I reviewed the suggested duplicates.
This issue may be related to #25372 / #25325, but I think it is still useful to keep it open because the behavior changed in a newer Codex Desktop build:
>>continuation prompt.OpenAI.Codex_26.602.4764.0_x64__2p2nqsd0c76g0.So this may be the same root cause, but the current user-visible failure mode is different.
I can reproduce this on a newer Windows Codex Desktop build as well.
Environment:
OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g00.142.4powershell -NoProfile -ExecutionPolicy Bypass -File <repo>\scripts\start-local-server.ps1 -Port 3000Observed behavior:
Expected behavior:
Impact:
This makes Environment actions hard to use for local dev servers because starting/stopping the server interrupts the active coding conversation.
Extremely annoying that my chat is closed, even though the run is to test the things changed in the current chat.