Skip to content

Git Bash fails inside Windows sandbox with "couldn't create signal pipe, Win32 error 5" #15016

Open

Description

@BlackCatCmx

Summary

On Windows, exec_command fails when shell is set to bash and Windows sandbox is enabled.

In my local testing, the same workflow worked on 0.114.0 and started failing on 0.115.0.

This reproduces with both:

  • sandbox = "unelevated"
  • sandbox = "elevated"

Setting sandbox_private_desktop = false does not change the behavior.

Reproduction

  1. Enable Windows sandbox in config.toml, for example:
[windows]
sandbox = "unelevated"
sandbox_private_desktop = false
  1. Run an exec_command call with shell: "bash", for example:
{"cmd":"sed -n '1,100p' CHANGELOG_CN.md","shell":"bash"}
  1. Observe this error:
[main] bash (4572) C:\Program Files\Git\usr\bin\bash.exe: *** fatal error - couldn't create signal pipe, Win32 error 5

Expected

Git Bash commands should run normally when invoked through exec_command.

Actual

bash.exe immediately fails with:

fatal error - couldn't create signal pipe, Win32 error 5

whenever Windows sandbox is enabled.

Notes

  • Removing [windows].sandbox makes everything work again.
  • sandbox_private_desktop = false does not help, so this does not appear to be specific to private desktop mode.
  • PowerShell works as a workaround.

Activity

  1. added
    bug
    CLI
    windows-os
    sandbox
    tool-calls
    on Mar 18, 2026
  2. removed
    CLI
    on Mar 18, 2026
  3. haodeon commented on May 27, 2026

    @haodeon

    I was also confused by this change in behaviour initially. From the changelog, it looks like the fix for #14367 is the cause.

  4. misaya98 commented on Jul 8, 2026

    @misaya98

    any updates ?

  5. shoepub-creator commented on Sep 30, 2026

    @shoepub-creator

    Reproduced in Codex desktop on Windows 25H2 (build 26200.9457), Codex CLI 0.159.0, workspace-write, with [windows] sandbox = "unelevated". The ordinary runner is a medium-integrity, non-admin token derived from the signed-in user.

    Both Codex-bundled Git 2.53.0.windows.3 and separately installed Git 2.56.0.windows.1 are affected. Running either installation's usr/bin/sh.exe with a print-only command (sh.exe -c 'printf SH_OK') immediately fails with "couldn't create signal pipe, Win32 error 5" (process exit 0xC0000142). PowerShell commands work.

    Impact: In an isolated, disposable repository inside the writable workspace, git clone --local --no-hardlinks --no-checkout --no-tags exits 128 before creating the destination. GIT_TRACE shows Git starting git-upload-pack for the local path via usr/bin/sh.exe -c, followed by the same pipe error. Changing the source to a relative path and using the newer system Git produced the same result. By comparison, creating a Git bundle and cloning from that bundle succeeded under the same ordinary runner.

    Could you investigate the MSYS sh.exe signal-pipe failure under the Windows sandbox, and advise a supported fix? No project paths or logs are included here.

  6. moruku36 commented on Oct 10, 2026

    @moruku36

    In a restricted Codex Desktop execution context on Windows, Claude Code 2.1.296 starts and completes read-only work, but its Bash tool reports NtCreateDirectoryObject 0xC0000022 and exit code 66 before a requested Python command starts.

    Environment: Windows NT 10.0.26300.0 x64, PowerShell 7.4.20. These errors are reported in Claude’s result JSON; a complete raw Bash log is unavailable. No additional reproduction or security-setting changes have been performed.

    Could this be related to the Windows/MSYS process-start failure discussed here? What supported diagnostics can distinguish an intentional sandbox restriction from an execution defect?

  7. crazy-vedic commented on Oct 14, 2026

    @crazy-vedic

    I also noticed this.

  8. oraclexing commented on Oct 17, 2026

    @oraclexing

    Additional reproduction in a Windows desktop local task, with a distinction between the network restriction and the shell/helper failure:

    • Desktop version: 26.1013.4894.0
    • Codex CLI: 0.159.2
    • In an isolated test repository, git init, git add, and git commit succeeded without an approval card.
    • An HTTPS clone initially failed with connection refused to 127.0.0.1:9. That proxy value was present in the process environment; no Git proxy configuration keys were found.
    • A subsequent user-requested, single-command direct-connection attempt reached Git's authentication-prompt path, where sh/bash failed with couldn't create signal pipe, Win32 error 5, followed by failed to execute prompt script (exit code 66) and failure to read the GitHub username.
    • Clone did not complete. Push was not tested. Further network attempts have been stopped.

    After this attempt, we verified that the official Windows sandbox source intentionally uses port 9 in apply_no_network_to_env; spawn preparation applies it when network blocking is required. The direct-connection attempt is reported only as historical diagnostic context, not recommended as a bypass or remedy. This report does not establish that the initial network restriction was erroneous, that credentials are invalid, or that Git metadata writes are generally blocked.

    The signal-pipe failure appears related to this issue. Could maintainers advise supported diagnostics or a fix for the shell/helper startup failure while preserving the intended sandbox and network policy? No private repository names, local user paths, session identifiers, or credentials are included.

    Update (2026-10-17): successful tests through the supported approval/escalation path. In the same fresh test thread, two requests using the formal require_escalated path succeeded. Private Git remote reads, a push to an isolated test branch, and subsequent retrieval and verification of both the commit hash and text content all passed. No persistent network or credential settings were changed, and the no-network proxy variables were not cleared for these tests.

    A second comparison used another pre-existing executor thread that had previously been idle. Two formal require_escalated requests also succeeded there: private remote reads, a local commit, a push, and a fetch into a second empty repository, followed by matching the commit hash and all three lines of test text.

    In both comparisons, the tool returned neither a denial nor a pending user-click state; this does not establish whether an approval card briefly appeared in the UI. The earlier default-sandbox errors remain historical observations, but these smoke tests are successful and should not be described as continuing failures. The older-thread comparison does not establish that every historically affected thread, or any previously reported approval-loop failure, is fixed. This update concerns only these tests and does not establish that the issue is resolved for other reporters.

  9. ghostinanutshell commented on Oct 21, 2026

    @ghostinanutshell

    Possibly related observation from a local Windows Codex Desktop task; this is not a confirmed duplicate of the signal-pipe failure.

    On 2026-10-21, two normal git hook run post-checkout invocations returned native Git exit code 66. Git was 2.54.0.windows.1, invoked through PowerShell -> Python -> native Git in an existing linked worktree. Both complete stdout and stderr streams were captured directly by the Python parent and were empty (0 bytes each).

    The second invocation recorded equal local before/after checks in the same parent process: repository state, index, hook and Git executable bytes, hook configuration, and parent environment. The unchanged full parent environment dictionary was explicitly passed to Git. This records the requested environment, not independent observation of the environment actually applied to Git or any hook child.

    Unlike the earlier reports here, no signal-pipe or NtCreateDirectoryObject diagnostic was captured. We have not established whether the hook body or its interpreter started, or where code 66 originated. The inspected hook source has no explicit exit-66 branch; that alone does not prove execution.

    No further hook attempts, sandbox/security-setting changes, or instrumentation have been performed since these observations. Exact Codex app and Windows build versions were not captured, so I cannot provide them reliably from this evidence.

    Could maintainers advise a supported passive diagnostic source for distinguishing Git/MSYS interpreter startup failure from an intentional execution restriction, while preserving the sandbox and without repeating the hook? No private repository paths, session transcripts, environment values, or credentials are included.

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

    bugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions