[Windows] Running an Environment Action navigates away from the current task while the command keeps running

Resolved 💬 0 comments Opened Jul 11, 2026 by myagmb28Dev Closed Jul 17, 2026

What version of the Codex App are you using (From “About Codex” dialog)?

26.707.3748.0

What subscription do you have?

ChatGPT Pro 20X

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

When I toggle/run an Action defined in .codex/environments/environment.toml from Codex Desktop on Windows, Codex opens a PowerShell window in the workspace and starts the configured command successfully. About one second later, however, the app navigates away from the current task to the main/new-task screen that asks what I want to build.

The command itself is not failing: the development server remains running in the spawned shell. The problem is the Codex Desktop navigation state. I am unexpectedly ejected from the active task even though the Action process is still alive.

This has happened consistently for several months.

This appears related to, but is more specific than, #28229: in my case the navigation happens immediately after launching a project Environment Action, without closing the terminal. It also overlaps with the Windows project Action behavior in #21731, but the shell continuation/exit state is not the trigger here because the same navigation occurs while a long-running foreground process remains active.

What steps can reproduce the bug?

  1. On Windows, open a repository as a task in Codex Desktop.
  2. Add the following tracked configuration:
version = 1
name = "Deluxine"

[setup]
script = ""

[[actions]]
name = "실행됨"
icon = "run"
command = "bun.exe run dev"
  1. Make sure bun.exe run dev starts a long-running development server normally when entered manually in a terminal.
  2. In Codex Desktop, toggle/run the Environment Action.
  3. Observe that a PowerShell window opens in the correct workspace and the development server starts successfully.
  4. Wait about one second.
  5. Codex Desktop navigates away from the active task to the main/new-task screen, while the PowerShell window and development server continue running.

I also reproduced this with:

command = "npm run dev"

On my system, PowerShell resolves that to npm.ps1, which is blocked by the execution policy. To separate that unrelated shell error from the navigation bug, I then tried:

command = "bun.exe run dev"

The Bun command runs correctly and stays alive, but Codex still navigates away. Therefore, keeping the terminal/process alive does not prevent the bug.

The issue reproduces in an ordinary repository task and does not depend on the backend application itself.

What is the expected behavior?

Launching an Environment Action should keep the current Codex task selected. The action terminal may open or remain running, but the app must not navigate to the main/new-task screen.

If the Action fails, Codex should remain in the same task and show the failure there. If it starts a long-running process successfully, the current task should remain active until I explicitly navigate away.

Additional information

Workarounds currently available:

  • Run bun run dev manually in the task terminal instead of using the Action toggle.
  • After Codex navigates away, use Back to return to the original task.

What I verified:

  • The configured working directory is correct.
  • The Action command actually executes.
  • bun.exe is available and the development server remains alive.
  • Replacing npm with bun.exe avoids the local PowerShell npm.ps1 execution-policy error, but does not affect the Codex navigation bug.
  • Using a long-running foreground command disproves shell exit as the cause of the navigation.
  • The failure is reproducible across repeated Action launches.

Potential regression area: the Windows Codex Desktop handler that synchronizes an Environment Action terminal launch with current-task routing/navigation state.

Related reports:

  • #28229
  • #21731

View original on GitHub ↗