diff --git a/codex-rs/core/src/models_manager/manager_tests.rs b/codex-rs/core/src/models_manager/manager_tests.rs index 6ab1c267bb..947ba7cc98 100644 --- a/codex-rs/core/src/models_manager/manager_tests.rs +++ b/codex-rs/core/src/models_manager/manager_tests.rs @@ -142,23 +142,28 @@ mv tokens.next tokens.txt #[cfg(windows)] let (command, args) = { - let script_path = tempdir.path().join("print-token.ps1"); + let script_path = tempdir.path().join("print-token.cmd"); std::fs::write( &script_path, - r#"$lines = @(Get-Content -Path tokens.txt) -if ($lines.Count -eq 0) { exit 1 } -Write-Output $lines[0] -$lines | Select-Object -Skip 1 | Set-Content -Path tokens.txt + r#"@echo off +setlocal EnableExtensions DisableDelayedExpansion +set "first_line=" + ModelProviderAuthInfo { let timeout_ms = if cfg!(windows) { - // `powershell.exe` startup can be slow on loaded Windows CI workers + // Process startup can be slow on loaded Windows CI workers. 10_000 } else { 2_000 diff --git a/codex-rs/login/src/auth/auth_tests.rs b/codex-rs/login/src/auth/auth_tests.rs index 3ee877872f..dc5e2908d2 100644 --- a/codex-rs/login/src/auth/auth_tests.rs +++ b/codex-rs/login/src/auth/auth_tests.rs @@ -385,23 +385,28 @@ mv tokens.next tokens.txt #[cfg(windows)] let (command, args) = { - let script_path = tempdir.path().join("print-token.ps1"); + let script_path = tempdir.path().join("print-token.cmd"); std::fs::write( &script_path, - r#"$lines = @(Get-Content -Path tokens.txt) -if ($lines.Count -eq 0) { exit 1 } -Write-Output $lines[0] -$lines | Select-Object -Skip 1 | Set-Content -Path tokens.txt + r#"@echo off +setlocal EnableExtensions DisableDelayedExpansion +set "first_line=" +