Skip to content

Windows: tool-called PowerShell fails before command execution, even for trivial commands like 'exit 0' #18465

Closed

Description

@aahljhljhlj-ux

Windows: tool-called PowerShell fails before command execution, even for trivial commands like 'exit 0'

What version of Codex is running?

codex-cli 0.121.0

Which model were you using?

gpt-5.4

What platform is your computer?

Windows

What issue are you seeing?

When Codex invokes PowerShell through its shell tool, the tool call fails before the actual command executes.

This does not appear to be a general PowerShell issue on the host machine. PowerShell can be launched manually outside Codex, but Codex tool calls fail immediately, even for trivial commands.

What steps can reproduce the bug?

  1. Start Codex on Windows
  2. Ask Codex to run a simple shell command, for example:
    • exit 0
    • Write-Output hello
    • [Environment]::CurrentDirectory
  3. Observe that the tool call fails before the command actually runs

What is the expected behavior?

Codex should successfully start PowerShell and execute the requested command.

What do you see instead?

The tool call fails immediately.

Observed behavior:

  • exit code: -65536
  • output includes: 0x8009001d

Example failing commands:

exit 0
Write-Output hello
[Environment]::CurrentDirectory

Additional information

Manual PowerShell invocation outside Codex works normally, so this appears to be specific to Codex's shell/tool execution path rather than PowerShell itself.

Impact:

  • shell commands cannot be executed reliably from Codex
  • environment setup commands are blocked
  • file inspection and edit workflows are blocked

Activity

  1. added
    bug
    CLI
    windows-os
    tool-calls
    on Apr 18, 2026
  2. aahljhljhlj-ux commented on Apr 18, 2026

    @aahljhljhlj-ux
    Author

    Thanks. After comparing the linked issues, this looks much closer to #13917 than to #18451. The key symptom here is that Codex-hosted PowerShell fails before command execution with 8009001d, while manual PowerShell outside Codex works normally.\n\nSince #13917 was already marked by a collaborator as a duplicate of #9062, I am closing this as a duplicate of #9062 to consolidate tracking there.

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

    CLIbugtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions