Skip to content

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

Open

Description

@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

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    on Jun 6, 2026
  2. github-actions commented on Jun 6, 2026

    @github-actions
    Contributor
  3. RaidelRoss commented on Jun 6, 2026

    @RaidelRoss
    Author

    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:

    • In my current version, the old visible AttachConsole error dialog no longer appears.
    • The local action still executes successfully.
    • The active chat still closes/resets.
    • The integrated PowerShell terminal is left at the >> continuation prompt.
    • This reproduces on Codex Desktop package 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.

  4. kbaquri commented on Jun 30, 2026

    @kbaquri

    I can reproduce this on a newer Windows Codex Desktop build as well.

    Environment:

    • OS: Windows
    • Codex Desktop package: OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0
    • App-server reported version: 0.142.4
    • Workspace type: local Windows project
    • Shell/action command shape: PowerShell action that runs a project script to start a local Next.js dev server, e.g. powershell -NoProfile -ExecutionPolicy Bypass -File <repo>\scripts\start-local-server.ps1 -Port 3000

    Observed behavior:

    • Clicking the Environment action play button to run the local server switches/closes the current Codex chat thread and opens a new chat/thread in the same project.
    • The server command itself can run, but the active working context is lost from the UI.
    • Closing the local-server terminal from inside Codex also switches/closes the active thread and opens a new thread.
    • Tried changing the action to a separate launcher/wrapper approach; it did not solve the thread switching, so this appears tied to Codex Desktop action/terminal handling rather than the specific server script.

    Expected behavior:

    • The Environment action should run the configured command without replacing or closing the currently active chat thread.
    • Closing the action terminal should return to or preserve the same thread context.

    Impact:
    This makes Environment actions hard to use for local dev servers because starting/stopping the server interrupts the active coding conversation.

  5. Ali229 commented on Jul 13, 2026

    @Ali229

    Extremely annoying that my chat is closed, even though the run is to test the things changed in the current chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions