From c59ee6a8d3a4e8bc59e903ccac1d08da679809e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 12:31:32 +0000 Subject: [PATCH 1/2] Initial plan From c0d3194168aee0038078a7b4972f799a9d9b4f24 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 12:47:18 +0000 Subject: [PATCH 2/2] fix: use RawArguments for cmd/direct scenario to fix Windows integration failure The cmd/direct test scenario was using `call ""$binary"" --help` via ProcessStartInfo.ArgumentList. However, .NET's Windows argument escaping uses backslash-quote (`\"`) to escape embedded double-quotes, while cmd.exe uses double-double-quote (`""`). This mismatch caused cmd.exe to treat `"D:\path\gh-aw.exe"` (including the outer quotes) as the literal command name rather than a quoted executable path, producing: '"D:\a\gh-aw\gh-aw\gh-aw.exe"' is not recognized as an internal or external command, operable program or batch file. Fix: add a RawArguments parameter to Invoke-CliProcess that sets psi.Arguments directly (bypassing .NET auto-quoting), and use it for the cmd/direct case with the proper `""path\exe.exe" --help"` format. With cmd /s, the outer "" pair is stripped, leaving "path\exe.exe" --help which cmd.exe executes correctly. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/windows-cli-integration.yml | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows-cli-integration.yml b/.github/workflows/windows-cli-integration.yml index b74a5148e76..ca2efc76f57 100644 --- a/.github/workflows/windows-cli-integration.yml +++ b/.github/workflows/windows-cli-integration.yml @@ -80,6 +80,7 @@ jobs: param( [Parameter(Mandatory)] [string] $FilePath, [string[]] $ArgumentList = @(), + [string] $RawArguments = "", [int] $TimeoutMs = 30000, [string] $WorkingDirectory = (Get-Location).Path, [hashtable] $EnvironmentOverrides = @{}, @@ -97,8 +98,12 @@ jobs: $psi.RedirectStandardOutput = $true $psi.RedirectStandardError = $true - foreach ($arg in $ArgumentList) { - [void]$psi.ArgumentList.Add($arg) + if ($RawArguments) { + $psi.Arguments = $RawArguments + } else { + foreach ($arg in $ArgumentList) { + [void]$psi.ArgumentList.Add($arg) + } } if ($MinimalEnvironment) { @@ -123,12 +128,14 @@ jobs: } } + $displayArgs = if ($RawArguments) { $RawArguments } else { $ArgumentList -join ' ' } + $proc = [System.Diagnostics.Process]::Start($psi) $stdoutTask = $proc.StandardOutput.ReadToEndAsync() $stderrTask = $proc.StandardError.ReadToEndAsync() if (-not $proc.WaitForExit($TimeoutMs)) { try { $proc.Kill($true) } catch {} - throw "TIMEOUT: '$FilePath $($ArgumentList -join ' ')' exceeded ${TimeoutMs}ms" + throw "TIMEOUT: '$FilePath $displayArgs' exceeded ${TimeoutMs}ms" } $proc.WaitForExit() @@ -148,7 +155,7 @@ jobs: throw "Expected error pattern '$ExpectedErrorPattern' not found" } } elseif ($proc.ExitCode -ne 0) { - throw "Exit code $($proc.ExitCode) for '$FilePath $($ArgumentList -join ' ')'`n$output" + throw "Exit code $($proc.ExitCode) for '$FilePath $displayArgs'`n$output" } return @{ @@ -236,8 +243,13 @@ jobs: Invoke-CliProcess -FilePath "powershell" -ArgumentList @("-NoProfile", "-Command", $cmd) -EnvironmentOverrides $envOverrides -UnsetEnvironment $unsetVars -AssertNoAnsi:$assertNoAnsi | Out-Null } "cmd" { - $cmd = if ($scenario.launch -eq "path") { "gh-aw --help" } else { "call ""$binary"" --help" } - Invoke-CliProcess -FilePath "cmd" -ArgumentList @("/d", "/s", "/c", $cmd) -EnvironmentOverrides $envOverrides -UnsetEnvironment $unsetVars -AssertNoAnsi:$assertNoAnsi | Out-Null + if ($scenario.launch -eq "path") { + Invoke-CliProcess -FilePath "cmd" -ArgumentList @("/d", "/s", "/c", "gh-aw --help") -EnvironmentOverrides $envOverrides -UnsetEnvironment $unsetVars -AssertNoAnsi:$assertNoAnsi | Out-Null + } else { + # Use RawArguments to bypass .NET's \"..\" quoting which conflicts with cmd.exe's "".."" + # syntax. The outer "" pair is stripped by cmd /s, leaving "path\exe.exe" --help. + Invoke-CliProcess -FilePath "cmd" -RawArguments "/d /s /c `"`"$binary`" --help`"" -EnvironmentOverrides $envOverrides -UnsetEnvironment $unsetVars -AssertNoAnsi:$assertNoAnsi | Out-Null + } } default { throw "Unknown shell scenario: $($scenario.shell)"