Windows Codex Desktop local action executes but closes/resets chat and leaves PowerShell at >> prompt

Open 💬 4 comments Opened Jun 6, 2026 by RaidelRoss

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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗