Fix Windows ACP install: spawn powershell.exe directly instead of via bash#2832
Closed
h4root wants to merge 1 commit into
Closed
Fix Windows ACP install: spawn powershell.exe directly instead of via bash#2832h4root wants to merge 1 commit into
h4root wants to merge 1 commit into
Conversation
On Windows, CLI install commands for Claude and Codex are PowerShell one-liners. Wrapping them in `bash -l -c "..."` breaks nested quoting in the -Command argument and requires Git Bash to be present before the CLI itself is installed. Add `build_install_command` which detects `powershell.exe ...` commands and spawns them directly via `powershell.exe`, bypassing Git Bash for that step. npm adapter commands continue through the existing bash path. This also eliminates the `bash -l` login-shell startup overhead that caused installs to hang for 45+ minutes on some Windows machines. Fixes block#2401, fixes block#2407
Author
|
Closing — this is already fixed upstream in #2680 (is_powershell_command / install_powershell_command). This branch was based on a stale main and reimplements the same fix, less completely. Apologies for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2401, fixes #2407.
Problem
On Windows, the CLI install commands for the Claude and Codex ACP runtimes are PowerShell one-liners (see
managed_agents/discovery.rs):run_install_commandcurrently wraps every install command inbash -l -c "..."viainstall_shell_command. This has two consequences on Windows:-Commandargument collide with the outerbash -c "..."quoting, so the PowerShell one-liner is mangled.resolve_install_shellreturnsGIT_BASH_INSTALL_HINT(no suitable shell found) when Git Bash is absent, so the user cannot install the Claude/Codex CLI at all until they first install Git Bash.The
bash -llogin-shell startup also reads the user's full profile (nvm/conda/etc.), which is what produced the "took 45 minutes" report in #2401 before the 5-minute timeout killed it.Fix
Add
build_install_command, which on Windows detectspowershell.exe ...commands and spawnspowershell.exedirectly (withCREATE_NO_WINDOW), bypassing Git Bash for that step. Everything else — the npm adapter installs, all Unix — continues through the existinginstall_shell_commandpath unchanged.bash -lstartup cost.#[cfg(windows)]gates the whole addition, so macOS/Linux behavior is untouched.