mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:10:45 +00:00
test(parallels): retry Windows agent idle exits
This commit is contained in:
@@ -920,15 +920,19 @@ for ($attempt = 1; $attempt -le 2; $attempt++) {
|
||||
'--json'
|
||||
)
|
||||
$output = Invoke-OpenClaw @args 2>&1
|
||||
$agentExitCode = $LASTEXITCODE
|
||||
if ($null -ne $output) { $output | ForEach-Object { $_ } }
|
||||
if ($LASTEXITCODE -ne 0) { throw "agent failed with exit code $LASTEXITCODE" }
|
||||
if (($output | Out-String) -match '"finalAssistant(Raw|Visible)Text":\\s*"OK"') {
|
||||
if ($agentExitCode -eq 0 -and ($output | Out-String) -match '"finalAssistant(Raw|Visible)Text":\\s*"OK"') {
|
||||
$agentOk = $true
|
||||
break
|
||||
}
|
||||
if ($attempt -lt 2) {
|
||||
Write-Host "agent turn attempt $attempt finished without OK response; retrying"
|
||||
Write-Host "agent turn attempt $attempt failed or finished without OK response; retrying"
|
||||
Start-Sleep -Seconds 3
|
||||
continue
|
||||
}
|
||||
if ($agentExitCode -ne 0) {
|
||||
throw "agent failed with exit code $agentExitCode"
|
||||
}
|
||||
}
|
||||
if (-not $agentOk) { throw 'openclaw agent finished without OK response' }`,
|
||||
|
||||
Reference in New Issue
Block a user