Use PowerShell for Windows stdio test helper

Avoid cmd.exe echo quoting semantics in the Windows stdio client test by reading stdin and writing the JSON-RPC initialize response from PowerShell.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-05-06 16:02:24 -07:00
parent 256760d6b9
commit 9f125d25cb

View File

@@ -961,10 +961,11 @@ mod tests {
async fn connect_stdio_command_initializes_json_rpc_client_on_windows() {
let client = ExecServerClient::connect_stdio_command(StdioExecServerConnectArgs {
command: StdioExecServerCommand {
program: "cmd".to_string(),
program: "powershell".to_string(),
args: vec![
"/C".to_string(),
"set /p _line= & echo {^\"id^\":1,^\"result^\":{^\"sessionId^\":^\"stdio-test^\"}} & set /p _line= & ping -n 60 127.0.0.1 >nul".to_string(),
"-NoProfile".to_string(),
"-Command".to_string(),
"$null = [Console]::In.ReadLine(); [Console]::Out.WriteLine('{\"id\":1,\"result\":{\"sessionId\":\"stdio-test\"}}'); $null = [Console]::In.ReadLine(); Start-Sleep -Seconds 60".to_string(),
],
env: HashMap::new(),
cwd: None,