codex - 💡(How to fix) Fix Codex on VS Code(Windows) fails to start PowerShell for shell_command calls, causing all local shell operations to fail [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17325Fetched 2026-04-11 06:17:42
View on GitHub
Comments
3
Participants
3
Timeline
9
Reactions
1
Author
Timeline (top)
labeled ×4commented ×3cross-referenced ×1unlabeled ×1

Error Message

  1. All of them failed with the same PowerShell startup error
  • If PowerShell startup fails, Codex should either fall back to another safe shell strategy or surface a clear, readable error message explaining the root cause
  • The error output includes 8009001d, which may suggest a Windows PowerShell / security context / profile initialization problem, but from the user perspective this makes Codex unable to perform any shell-based local task.

This error appears to occur widely.

Root Cause

Symptoms:

  • shell_command fails immediately instead of running the requested command.
  • Simple commands such as Get-Location and Get-ChildItem fail.
  • Even attempts to invoke cmd /c ... through the shell tool still fail because the failure happens before the actual command runs.
  • As a result, Codex could not perform basic local file operations such as checking for a file or moving it.

Code Example

Exit code: -65536
´°€½ Windows PowerShell ... 8009001d ...


### What steps can reproduce the bug?

Uploaded thread: 019d76ea-171d-7a01-9ffa-7c7bb5e9c4d5
RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

26.406.31014

What subscription do you have?

ChatGPT Plus

Which IDE are you using?

VS Code

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

On Windows, Codex was able to complete browser-based actions such as a Playwright full-page screenshot, but every shell_command call failed at PowerShell startup.

Symptoms:

  • shell_command fails immediately instead of running the requested command.
  • Simple commands such as Get-Location and Get-ChildItem fail.
  • Even attempts to invoke cmd /c ... through the shell tool still fail because the failure happens before the actual command runs.
  • As a result, Codex could not perform basic local file operations such as checking for a file or moving it.

Observed output:

Exit code: -65536
´°€½ Windows PowerShell ... 8009001d ...


### What steps can reproduce the bug?

Uploaded thread: 019d76ea-171d-7a01-9ffa-7c7bb5e9c4d5
  1. Run Codex in a Windows environment.
  2. Ask it to perform a browser automation task first, such as taking a full-page screenshot with Playwright.
  3. Then ask it to perform a local shell-based task, such as checking whether a file exists or moving a file.
  4. Codex attempts to use shell_command, but the call fails during PowerShell initialization.

Actual flow that reproduced the issue:

  1. Asked Codex to take a full-page screenshot of https://scin.kr/
  2. Codex successfully created scin-kr-fullpage.png
  3. Asked Codex to move that file into a target folder
  4. Codex tried commands such as Get-Location, Get-ChildItem, and cmd /c ...
  5. All of them failed with the same PowerShell startup error

Minimal repro:

  • Ask Codex on Windows to run any simple shell command
  • Examples: print current directory, list files, or move a file
  • Instead of executing the command, Codex fails at PowerShell startup

What is the expected behavior?

Codex should be able to run shell_command normally on Windows.

For example:

  • Basic PowerShell commands like Get-Location should succeed
  • Get-ChildItem should be able to list files
  • Local file operations such as copy/move should work
  • If PowerShell startup fails, Codex should either fall back to another safe shell strategy or surface a clear, readable error message explaining the root cause

Additional information

  • Playwright-based browser automation worked correctly.
  • The failure seems specific to shell_command execution, not browser automation.
  • The error output includes 8009001d, which may suggest a Windows PowerShell / security context / profile initialization problem, but from the user perspective this makes Codex unable to perform any shell-based local task.
  • Uploaded thread ID: 019d76ea-171d-7a01-9ffa-7c7bb5e9c4d5

This error appears to occur widely.

extent analysis

TL;DR

The issue can be resolved by investigating and addressing the PowerShell startup error, potentially related to security context or profile initialization, which prevents shell_command from executing successfully.

Guidance

  • Verify that PowerShell is working correctly outside of Codex by running simple commands like Get-Location and Get-ChildItem directly in PowerShell.
  • Check the Windows event logs for any errors related to PowerShell startup or security context issues.
  • Consider configuring Codex to use a different shell or fallback strategy when PowerShell startup fails.
  • Investigate the significance of the 8009001d error code in the context of Windows PowerShell and security settings.

Example

No specific code snippet is provided as the issue seems to be related to the environment and configuration rather than a specific code block.

Notes

The issue appears to be specific to the Windows environment and PowerShell, and the provided error code 8009001d may indicate a security or profile initialization problem. Further investigation into Windows and PowerShell settings is necessary to resolve the issue.

Recommendation

Apply a workaround by configuring Codex to use a different shell or fallback strategy when PowerShell startup fails, as the root cause of the issue is not immediately clear and may require additional troubleshooting.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING