


























@@ -33,7 +33,7 @@ import { WindowsGuest } from "./guest-transports.ts";
3333import { runSmokeLane, type SmokeLane, type SmokeLaneStatus } from "./lane-runner.ts";
3434import { waitForVmStatus } from "./parallels-vm.ts";
3535import { PhaseRunner } from "./phase-runner.ts";
36-import { encodePowerShell, psArray, psSingleQuote, windowsOpenClawResolver } from "./powershell.ts";
36+import { encodePowerShell, psSingleQuote, windowsOpenClawResolver } from "./powershell.ts";
3737import { ensureGuestGit, prepareMinGitZip } from "./windows-git.ts";
38383939interface WindowsOptions {
@@ -891,27 +891,40 @@ Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json
891891if ($LASTEXITCODE -ne 0) { throw "config set failed" }
892892Invoke-OpenClaw config set tools.profile minimal
893893if ($LASTEXITCODE -ne 0) { throw "tools profile config set failed" }
894-$sessionPath = Join-Path $env:USERPROFILE '.openclaw\\agents\\main\\sessions\\parallels-windows-smoke.jsonl'
895-Remove-Item $sessionPath -Force -ErrorAction SilentlyContinue
896894${windowsAgentWorkspaceScript("Parallels Windows smoke test assistant.")}
897895Set-Item -Path ('Env:' + ${psSingleQuote(this.auth.apiKeyEnv)}) -Value ${psSingleQuote(this.auth.apiKeyValue)}
898-$args = ${psArray([
899- "agent",
900- "--local",
901- "--agent",
902- "main",
903- "--session-id",
904- "parallels-windows-smoke",
905- "--message",
906- "Reply with exact ASCII text OK only.",
907- "--thinking",
908- "minimal",
909- "--json",
910- ])}
911-$output = Invoke-OpenClaw @args 2>&1
912-if ($null -ne $output) { $output | ForEach-Object { $_ } }
913-if ($LASTEXITCODE -ne 0) { throw "agent failed with exit code $LASTEXITCODE" }
914-if (($output | Out-String) -notmatch '"finalAssistant(Raw|Visible)Text":\\s*"OK"') { throw 'openclaw agent finished without OK response' }`,
896+$agentOk = $false
897+for ($attempt = 1; $attempt -le 2; $attempt++) {
898+ $sessionId = if ($attempt -eq 1) { 'parallels-windows-smoke' } else { "parallels-windows-smoke-retry-$attempt" }
899+ $sessionsDir = Join-Path $env:USERPROFILE '.openclaw\\agents\\main\\sessions'
900+ $sessionPath = Join-Path $sessionsDir "$sessionId.jsonl"
901+ Remove-Item $sessionPath -Force -ErrorAction SilentlyContinue
902+ $args = @(
903+ 'agent',
904+ '--local',
905+ '--agent',
906+ 'main',
907+ '--session-id',
908+ $sessionId,
909+ '--message',
910+ 'Reply with exact ASCII text OK only.',
911+ '--thinking',
912+ 'minimal',
913+ '--json'
914+ )
915+ $output = Invoke-OpenClaw @args 2>&1
916+ if ($null -ne $output) { $output | ForEach-Object { $_ } }
917+ if ($LASTEXITCODE -ne 0) { throw "agent failed with exit code $LASTEXITCODE" }
918+ if (($output | Out-String) -match '"finalAssistant(Raw|Visible)Text":\\s*"OK"') {
919+ $agentOk = $true
920+ break
921+ }
922+ if ($attempt -lt 2) {
923+ Write-Host "agent turn attempt $attempt finished without OK response; retrying"
924+ Start-Sleep -Seconds 3
925+ }
926+}
927+if (-not $agentOk) { throw 'openclaw agent finished without OK response' }`,
915928Number(process.env.OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S || 900) * 1000,
916929);
917930}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。