Windows Codex Desktop: Git sh.exe --version exits 0xC0000142 while an external PowerShell launch succeeds
What version of the Codex App are you using?
Not captured in the existing evidence. No additional version collection was performed for this report.
What subscription do you have?
Not included.
What platform is your computer?
Windows. Exact Windows build and Git package version are not captured.
What issue are you seeing?
A neutral Git shell version query failed during one observed launch in the Codex execution context, while an earlier external-terminal observation succeeded.
Target: C:/Program Files/Git/usr/bin/sh.exe --version.
Both observations used the same declared project directory and the same observed pre-start shell SHA256. This was not a simultaneous or single-variable experiment.
| Observation on 2026-11-10 | Native target exit | stdout | stderr |
|---|---|---|---|
| Ordinary external Windows PowerShell, reported by the operator as non-elevated; target ended 08:49:14 UTC | 0 | 304 bytes | 0 bytes |
Codex exec_command, login=false, sandbox_permissions=use_default; target ended 09:12:55 UTC |
3221225794 / 0xC0000142 |
0 bytes | 0 bytes |
The successful output began:
GNU bash, version 5.3.9(1)-release (x86_64-pc-cygwin)
The target exited naturally; no forced termination was requested. The outer Codex tool returned exit 0, which is separate from the failing child process's native exit. The external wrapper exit was not observed.
The outer Codex output also contained:
Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed.
This warning was outside the empty target streams. Its causal relationship to the target failure is unknown.
What steps can reproduce the bug?
These are the already observed steps, not a new or generally validated reproduction recipe:
- Run a bounded Python capture wrapper once from an ordinary external, non-elevated Windows PowerShell terminal. The wrapper launches the fixed target with
shell=False, captures stdout/stderr to files and obtains the target's native process exit separately. - Later, invoke a closely comparable wrapper once through Codex
exec_commandwithlogin=false, default sandbox permissions and the same declared working directory. - Compare the target exit and raw streams: the external observation succeeded, while the Codex observation returned
0xC0000142.
No hook execution, Git worktree creation or commit was involved in this neutral comparison. No repeat series or broader failure rate is claimed.
What is the expected behavior?
The neutral version query should start successfully through the regular Codex execution context and return version output with exit 0.
Additional information
This is a suspected execution-context integration bug, not a proven Codex, DLL or permission root cause. Time, parent process, token, environment, handles, profiles and protection context may differ. Matching pre-start bytes do not prove identical loaded-image state.
Related reports found during duplicate checking:
- #56910 reports broader failures across multiple binaries and sandbox modes.
- #16401 describes a different reported helper-materialization failure affecting shell_command globally.
- #17847 describes an SSH-specific launch context.
The same status code alone does not establish that this observation has the same cause or is an exact duplicate. Please triage the relationship.
Please advise whether the Codex process-start context could explain this difference and which narrowly scoped diagnostic fields would be useful next. No proposed repair was tested. No permission weakening is requested.
No raw logs, session transcript, screenshots, private project paths, process identifiers or attachments are included.
Proposed support addendum: Windows command-runner exit reporting during a normal Git commit
This is an additional observation, not a claim that it has the same cause as the historical shell-launch failure discussed here.
On Windows, a Codex command-runner invocation of a normal git commit -m "<redacted message>" returned tool exit_code: 1. The only combined output was:
Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed.
In the same context, five read-only Git commands (log, status, staged diff, the relevant hook-selection config read, and var GIT_SHELL_PATH) returned tool exit code 0. Their output also contained that provider diagnostic. A separately permitted terminal git log read still showed the previous HEAD.
The command requested PowerShell with login disabled and the normal default workspace execution route. No hook bypass, persistent configuration change, elevated fallback, or retry was used. The selected hook sources were checked as data before the attempt. This establishes source selection, not that Git or a hook actually entered execution.
We cannot determine from the available return whether exit 1 came from Git, a child process, or the command-runner boundary. Actual Git PID, native launch timestamp, worker identity/version, native child exit status, separate stdout/stderr association, hook entry, and other partial effects remain unknown. The provider diagnostic is not by itself causal evidence, because it also occurs with successful reads. No new commit at HEAD was observed; that is not a guarantee of zero other effects.
Could maintainers identify the supported way to correlate the already-recorded command invocation with its existing launch/worker record and native Git/child completion data? We specifically need the invocation-to-process join and exit/output attribution. Please prefer existing telemetry over asking for another commit or hook reproduction. If a new capture is necessary, please name the exact supported capture surface and minimal non-commit operation it requires.
Private correlation details and originals are retained locally and are not attached here. No causal repair has been identified. No reproduction, configuration repair, or additional execution is authorized by this proposed report.