codex - 💡(How to fix) Fix ERROR codex_core::tools::router: error=Exit code: -1073741502 [1 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#17847Fetched 2026-04-15 06:27:16
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×5unlabeled ×1

Error Message

The log file would have this line: ERROR codex_core::tools::router: error=Exit code: -1073741502

Root Cause

I couldn’t analyze the current directory because command execution is failing at the environment level. Every attempt to run even minimal commands like dir, pwd, git status, or cmd /c dir exited immediately with code -1073741502 and no output."

Code Example

model = "gpt-5.4"
[projects.'C:\jenkins\workspace\MyProject']
trust_level = "trusted"

[windows]
sandbox = "unelevated"
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.120.0

What subscription do you have?

ChatGPT Business

Which model were you using?

gpt-5.4-mini

What platform is your computer?

Microsoft Windows NT 10.0.19043.0 x64

What terminal emulator and version are you using (if applicable)?

PowerShell

What issue are you seeing?

The issue appears when executing Codex in SSH session, like through Jenkins or just SSH into machine and running codex in unelevated sandbox.

Codex response to any prompt that would require reading files from working directory:

I couldn’t analyze the current directory because command execution is failing at the environment level. Every attempt to run even minimal commands like dir, pwd, git status, or cmd /c dir exited immediately with code -1073741502 and no output."

The log file would have this line: ERROR codex_core::tools::router: error=Exit code: -1073741502 Investigatin this further it appears to be 0xC0000142 which is STATUS_DLL_INIT_FAILED

When running codex interactively it would ask to run commands with elevated permissions this is no go for me as I'm trying to wrap up everything in script.

--yolo does fix this issue but I have a security concerns with this method

config.toml

model = "gpt-5.4"
[projects.'C:\jenkins\workspace\MyProject']
trust_level = "trusted"

[windows]
sandbox = "unelevated"

The issue is specific to SSH session, when running it on the actural machine under same user it works fine. I've compared the environments and haven't spotted anything that would point out to the issue.

Last known working version is 0.46.0

What steps can reproduce the bug?

  1. Set up a Windows machine with Codex version above 0.46.0
  2. Connect via SSH (any SSH client)
  3. Navigate to a trusted project directory with workspace-write and trust_level = "trusted" in config
  4. Run codex and ask anything that would require executing commands in the workdir, like "what's in this directory"
  5. Observe Exit code: -1073741502 and escalation request

What is the expected behavior?

Unelevated sandbox should be able to spawn shell processes in SSH sessions

Additional information

  • Last known working version is 0.46.0
  • Removing .codex folder didn't help
  • Tried to downgrade version by version down to 0.115.0
  • Result same for interactive and codex exec variants of running codex

extent analysis

TL;DR

The issue can be potentially resolved by downgrading Codex CLI to version 0.46.0, as it is the last known working version.

Guidance

  • Verify that the issue is indeed specific to SSH sessions and not present when running Codex interactively on the actual machine.
  • Investigate the differences in environment variables and system settings between the SSH session and the interactive session to identify potential causes.
  • Consider testing with a different sandbox setting or trust level to see if the issue is related to the current configuration.
  • Review the config.toml file to ensure that the sandbox setting is correctly configured for the project directory.

Example

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

Notes

The issue appears to be related to a change introduced in Codex CLI version 0.47.0 or later, as downgrading to 0.46.0 resolves the issue. However, downgrading may not be a viable long-term solution, and further investigation is needed to identify the root cause.

Recommendation

Apply workaround: Downgrade to version 0.46.0, as it is the last known working version, while continuing to investigate the root cause of the issue.

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

codex - 💡(How to fix) Fix ERROR codex_core::tools::router: error=Exit code: -1073741502 [1 participants]