From 7b6e0722de2edbb4fc393552f1f23a7c64395733 Mon Sep 17 00:00:00 2001 From: Dustin <204417361+Koraji95-coder@users.noreply.github.com> Date: Sat, 23 May 2026 18:05:38 -0500 Subject: [PATCH] fix(start.ps1): drop non-functional @args splat under [CmdletBinding()] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot's review of this PR caught that the `& $Python $serverPath @args` splat at the launcher line was always empty in practice: PowerShell does NOT populate the automatic $args variable when a script declares [CmdletBinding()] with an explicit param() block, which start.ps1 does. Any caller who tried to pass extra args (matching start.sh's "$@" behavior) would already hit "A positional parameter cannot be found that accepts argument ..." before this line ever ran — so the @args here was dead code that misled readers into thinking pass-through worked when it didn't. Two options to address: 1. Drop @args. Restores honesty — script is documented as the env-var-driven launcher, and the param block already covers the two explicit parameters (-Port, -BindHost). No behavior change for any working call shape. 2. Add `[Parameter(ValueFromRemainingArguments=$true)] [string[]]$ServerArgs` to the param block and splat that. Adds pass-through capability that start.sh has but start.ps1 didn't. Picked (1) for this hardening PR — keeps scope focused on the two Copilot-flagged issues I already addressed (TryParse + exit-after-finally). Option (2) is a small follow-up if anyone reports needing it. Note attached at the launch site documenting why @args was dropped and how to add ValueFromRemainingArguments if the need surfaces later. Co-Authored-By: Claude Opus 4.7 (1M context) --- start.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/start.ps1 b/start.ps1 index 9512937d..43e89be8 100644 --- a/start.ps1 +++ b/start.ps1 @@ -174,7 +174,13 @@ if (-not (Test-Path $serverPath)) { $script:serverExitCode = 0 Push-Location $RepoRoot try { - & $Python $serverPath @args + # @args was non-functional here — PowerShell does NOT populate $args when the + # script declares [CmdletBinding()] with an explicit param() block (Copilot's + # finding on PR #2807). Dropped rather than added a ValueFromRemainingArguments + # parameter, because the existing tracked use case is the launcher running + # server.py with the env-var-driven config — no pass-through args are needed. + # If pass-through becomes a requirement later, add a [Parameter(ValueFromRemainingArguments=$true)] [string[]]$ServerArgs and splat that. + & $Python $serverPath $script:serverExitCode = $LASTEXITCODE } finally { Pop-Location