From d3bb5ce9e9d625f55f6b1fd0bf3c9c96a40739af Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 11:17:47 +0100 Subject: [PATCH] test: write Windows Parallels provider timeout directly --- scripts/e2e/parallels/npm-update-scripts.ts | 15 ++++++++++++++- scripts/e2e/parallels/windows-smoke.ts | 16 ++++++++++++++-- test/scripts/parallels-smoke-model.test.ts | 4 ++-- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/scripts/e2e/parallels/npm-update-scripts.ts b/scripts/e2e/parallels/npm-update-scripts.ts index fda3b868877..95510c40683 100644 --- a/scripts/e2e/parallels/npm-update-scripts.ts +++ b/scripts/e2e/parallels/npm-update-scripts.ts @@ -143,7 +143,20 @@ Wait-OpenClawGateway Invoke-OpenClaw models set ${psSingleQuote(input.auth.modelId)} Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json Invoke-OpenClaw config set tools.profile minimal -Invoke-OpenClaw config set models.providers.openai ${psSingleQuote('{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}')} --strict-json +$configPath = Join-Path $env:USERPROFILE '.openclaw\\openclaw.json' +$config = Get-Content $configPath -Raw | ConvertFrom-Json +if ($null -eq $config.models) { + $config | Add-Member -MemberType NoteProperty -Name models -Value ([pscustomobject]@{}) +} +if ($null -eq $config.models.providers) { + $config.models | Add-Member -MemberType NoteProperty -Name providers -Value ([pscustomobject]@{}) +} +$config.models.providers | Add-Member -Force -MemberType NoteProperty -Name openai -Value ([pscustomobject]@{ + baseUrl = 'https://api.openai.com/v1' + models = @() + timeoutSeconds = 300 +}) +$config | ConvertTo-Json -Depth 100 | Set-Content -Path $configPath -Encoding utf8 ${windowsAgentWorkspaceScript("Parallels npm update smoke test assistant.")} Set-Item -Path ('Env:' + ${psSingleQuote(input.auth.apiKeyEnv)}) -Value ${psSingleQuote(input.auth.apiKeyValue)} Invoke-OpenClaw agent --local --agent main --session-id parallels-npm-update-windows --message 'Reply with exact ASCII text OK only.' --thinking minimal --json`; diff --git a/scripts/e2e/parallels/windows-smoke.ts b/scripts/e2e/parallels/windows-smoke.ts index 0045ce8787e..1c09d168425 100755 --- a/scripts/e2e/parallels/windows-smoke.ts +++ b/scripts/e2e/parallels/windows-smoke.ts @@ -890,8 +890,20 @@ Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json if ($LASTEXITCODE -ne 0) { throw "config set failed" } Invoke-OpenClaw config set tools.profile minimal if ($LASTEXITCODE -ne 0) { throw "tools profile config set failed" } -Invoke-OpenClaw config set models.providers.openai ${psSingleQuote('{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}')} --strict-json -if ($LASTEXITCODE -ne 0) { throw "openai provider timeout config set failed" } +$configPath = Join-Path $env:USERPROFILE '.openclaw\\openclaw.json' +$config = Get-Content $configPath -Raw | ConvertFrom-Json +if ($null -eq $config.models) { + $config | Add-Member -MemberType NoteProperty -Name models -Value ([pscustomobject]@{}) +} +if ($null -eq $config.models.providers) { + $config.models | Add-Member -MemberType NoteProperty -Name providers -Value ([pscustomobject]@{}) +} +$config.models.providers | Add-Member -Force -MemberType NoteProperty -Name openai -Value ([pscustomobject]@{ + baseUrl = 'https://api.openai.com/v1' + models = @() + timeoutSeconds = 300 +}) +$config | ConvertTo-Json -Depth 100 | Set-Content -Path $configPath -Encoding utf8 ${windowsAgentWorkspaceScript("Parallels Windows smoke test assistant.")} Set-Item -Path ('Env:' + ${psSingleQuote(this.auth.apiKeyEnv)}) -Value ${psSingleQuote(this.auth.apiKeyValue)} $args = ${psArray([ diff --git a/test/scripts/parallels-smoke-model.test.ts b/test/scripts/parallels-smoke-model.test.ts index e95696615aa..f36a71f4af4 100644 --- a/test/scripts/parallels-smoke-model.test.ts +++ b/test/scripts/parallels-smoke-model.test.ts @@ -422,8 +422,8 @@ console.log(JSON.stringify(result)); expect(script).toContain('guestPowerShellBackground(\n "agent-turn"'); expect(script).toContain("OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S"); expect(script).toContain("finalAssistant(Raw|Visible)Text"); - expect(script).toContain("models.providers.openai"); - expect(script).toContain('"timeoutSeconds":300'); + expect(script).toContain("$config.models.providers"); + expect(script).toContain("timeoutSeconds = 300"); }); it("waits through transient Windows restoring state before VM operations", () => {