Windows app 26.422.8496.0: all shell commands fail with "batch file arguments are invalid" after update

Open 💬 2 comments Opened Apr 28, 2026 by agent-wrangler

Summary

After updating Codex Windows app on 2026-04-28, all agent shell commands fail before execution with:

Io(Error { kind: InvalidInput, message: "batch file arguments are invalid" })

This happens even for minimal commands such as Get-Location and pwd.

Environment

  • Platform: Windows x64
  • Codex app package: OpenAI.Codex
  • Codex app version: 26.422.8496.0
  • Package full name: OpenAI.Codex_26.422.8496.0_x64__2p2nqsd0c76g0
  • Shell context: PowerShell

Minimal repro

  1. Open Codex Windows app.
  2. Open any thread/workspace.
  3. Ask the agent to run a minimal command:
  • Get-Location
  • or pwd
  1. The command fails immediately with:
Io(Error { kind: InvalidInput, message: "batch file arguments are invalid" })

Diagnostics already checked

Direct process launch outside the Codex shell tool works on the same machine:

  • cmd.exe /d /s /c echo OK_CMD succeeds.
  • WindowsPowerShell\v1.0\powershell.exe -NoProfile ... succeeds.
  • Windows PowerShell version observed: 5.1.22621.6060.

Get-Command pwsh -All shows a .cmd shim before the real PowerShell executable:

C:\Users\<USER>\AppData\Local\Microsoft\WindowsApps\pwsh.cmd
C:\Users\<USER>\AppData\Local\Programs\PowerShell\7\pwsh.exe

PowerShell 7 version observed: 7.4.15.

I also changed Codex config from:

[windows]
sandbox = "elevated"

to:

[windows]
sandbox = "unelevated"

The current thread still fails, so either the setting requires app restart or the failure occurs before this setting helps.

Expected behavior

The shell tool should execute minimal commands normally, or fall back to a valid PowerShell executable instead of failing during command launch.

Related context

There are recent Windows app / sandbox / child process environment issues, for example:
https://github.com/openai/codex/issues/18248

View original on GitHub ↗

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