Repository navigation
Studio: name the Git Bash MXC incompatibility and stop re-probing it - #12021
Conversation
Git for Windows' bash (MSYS2 runtime) cannot start inside an MXC AppContainer: msys-2.0.dll creates a directory under the global \BaseNamedObjects with NtCreateDirectoryObject, which the container denies (microsoft/mxc#1061). Classify that probe failure, cache it until the runtime, shell or opt-in changes instead of re-probing every 30s (about 15s of DACL-tier launches each time), and replace the install and host-prep remediation, which cannot help, with what actually happens: Python stays isolated, Terminal runs with software safeguards in Auto and is refused in Required.
…able An in-place Git for Windows upgrade keeps the path, so the cached verdict now also keys on bash.exe and msys-2.0.dll. The remediation names what the user can do instead of asserting Python isolation it never checked.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…nslothai#12021) Git for Windows' bash (MSYS2) cannot start inside an MXC AppContainer: msys-2.0.dll creates a directory under the global \BaseNamedObjects, which the container denies (microsoft/mxc#1061). The Terminal probe now reports that cause instead of a generic failure, caches it for 6 hours keyed on the runtime, the shell path, the opt-in and the bash.exe and msys-2.0.dll files instead of re-probing every 30 seconds (13 to 19 s of DACL-tier launches each time), and replaces the install and host-prep remediation with what the user can do: set tool isolation to auto, or use the Python tool, which is sandboxed separately.
Summary
On Windows, the Terminal tool runs Git Bash whenever Git for Windows is installed.
setup.ps1installs Git through winget when it is missing, so that is most Studio installs. Git Bash cannot start inside the MXC AppContainer:At startup,
msys-2.0.dllcreates a directory under the global\BaseNamedObjectswith an absolute NT path. AppContainer redirects only the Win32 named-object APIs, so the create is denied and bash dies in DLL init before it reads its command. This is tracked upstream as microsoft/mxc#1061. There is no MSYS2 setting or MXC grant that fixes it, andcmd.exepasses the same probe.Before this PR, with
UNSLOTH_MXC_ALLOW_DACL_FALLBACK=1:the live MXC probe did not complete cleanly.Changes
mxc_probe.pybash.execompletes with clean cleanup, a nonzero exit and the MSYSNtCreateDirectoryObject/\BaseNamedObjects\/0xC0000022output, it now returns a distinct reason (MSYS_NAMESPACE_REASON) that names the cause and the upstream issue.msys-2.0.dll. An in-place Git for Windows upgrade therefore probes again, as does a new runtime, a different shell or a flipped opt-in.sandbox_windows_mxc.py: for that reason, the remediation now says what the user can do: set tool isolation to auto to run Terminal with software safeguards, or use the Python tool, which is sandboxed separately. The host-preparation lookup, which cannot help here, is skipped.Unchanged:
Routing the isolated Terminal through
cmdorpwshis left for a follow-up. It needs the shell the model is told about, and the command analysis, to be chosen per request, andcmd /cruns only the first line of a multi-line command.Verification
Windows 24H2 (build 26100) hosted runner. The MXC runtime was installed from npm, followed by
--prepare-hostandUNSLOTH_MXC_ALLOW_DACL_FALLBACK=1. The same job ran on the merge base and on this branch. The Git Bash Terminal capability was read three times, 35 seconds apart (past the 30 s negative TTL), each read followed by an Auto Terminal call:the live MXC probe did not complete cleanlyGit Bash (MSYS2) cannot start in the MXC container, ...Test suites, merge base vs this PR, compared by failing test IDs:
test_mxc_native_windows.py -m native_mxcpowershell.exe5.1 does not pass the DACL-tier Terminal probe (pwshdoes).tests/test_mxc_git_bash_namespace.pyrun on Linux with fakes. They cover:msys-2.0.dllchangeprepare_tool_launchnative_mxctest checks the real Git Bash reason and that a second read does not probe again.Not covered: the BaseContainer tier (not available on the hosted 24H2 image), where the same MSYS failure is expected but unverified; Windows ARM64; Windows 10.