test: write Windows Parallels provider timeout directly · openclaw/openclaw@d3bb5ce
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -143,7 +143,20 @@ Wait-OpenClawGateway
|
143 | 143 | Invoke-OpenClaw models set ${psSingleQuote(input.auth.modelId)} |
144 | 144 | Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json |
145 | 145 | Invoke-OpenClaw config set tools.profile minimal |
146 | | -Invoke-OpenClaw config set models.providers.openai ${psSingleQuote('{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}')} --strict-json |
| 146 | +$configPath = Join-Path $env:USERPROFILE '.openclaw\\openclaw.json' |
| 147 | +$config = Get-Content $configPath -Raw | ConvertFrom-Json |
| 148 | +if ($null -eq $config.models) { |
| 149 | + $config | Add-Member -MemberType NoteProperty -Name models -Value ([pscustomobject]@{}) |
| 150 | +} |
| 151 | +if ($null -eq $config.models.providers) { |
| 152 | + $config.models | Add-Member -MemberType NoteProperty -Name providers -Value ([pscustomobject]@{}) |
| 153 | +} |
| 154 | +$config.models.providers | Add-Member -Force -MemberType NoteProperty -Name openai -Value ([pscustomobject]@{ |
| 155 | + baseUrl = 'https://api.openai.com/v1' |
| 156 | + models = @() |
| 157 | + timeoutSeconds = 300 |
| 158 | +}) |
| 159 | +$config | ConvertTo-Json -Depth 100 | Set-Content -Path $configPath -Encoding utf8 |
147 | 160 | ${windowsAgentWorkspaceScript("Parallels npm update smoke test assistant.")} |
148 | 161 | Set-Item -Path ('Env:' + ${psSingleQuote(input.auth.apiKeyEnv)}) -Value ${psSingleQuote(input.auth.apiKeyValue)} |
149 | 162 | Invoke-OpenClaw agent --local --agent main --session-id parallels-npm-update-windows --message 'Reply with exact ASCII text OK only.' --thinking minimal --json`; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -890,8 +890,20 @@ Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json
|
890 | 890 | if ($LASTEXITCODE -ne 0) { throw "config set failed" } |
891 | 891 | Invoke-OpenClaw config set tools.profile minimal |
892 | 892 | if ($LASTEXITCODE -ne 0) { throw "tools profile config set failed" } |
893 | | -Invoke-OpenClaw config set models.providers.openai ${psSingleQuote('{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}')} --strict-json |
894 | | -if ($LASTEXITCODE -ne 0) { throw "openai provider timeout config set failed" } |
| 893 | +$configPath = Join-Path $env:USERPROFILE '.openclaw\\openclaw.json' |
| 894 | +$config = Get-Content $configPath -Raw | ConvertFrom-Json |
| 895 | +if ($null -eq $config.models) { |
| 896 | + $config | Add-Member -MemberType NoteProperty -Name models -Value ([pscustomobject]@{}) |
| 897 | +} |
| 898 | +if ($null -eq $config.models.providers) { |
| 899 | + $config.models | Add-Member -MemberType NoteProperty -Name providers -Value ([pscustomobject]@{}) |
| 900 | +} |
| 901 | +$config.models.providers | Add-Member -Force -MemberType NoteProperty -Name openai -Value ([pscustomobject]@{ |
| 902 | + baseUrl = 'https://api.openai.com/v1' |
| 903 | + models = @() |
| 904 | + timeoutSeconds = 300 |
| 905 | +}) |
| 906 | +$config | ConvertTo-Json -Depth 100 | Set-Content -Path $configPath -Encoding utf8 |
895 | 907 | ${windowsAgentWorkspaceScript("Parallels Windows smoke test assistant.")} |
896 | 908 | Set-Item -Path ('Env:' + ${psSingleQuote(this.auth.apiKeyEnv)}) -Value ${psSingleQuote(this.auth.apiKeyValue)} |
897 | 909 | $args = ${psArray([ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -422,8 +422,8 @@ console.log(JSON.stringify(result));
|
422 | 422 | expect(script).toContain('guestPowerShellBackground(\n "agent-turn"'); |
423 | 423 | expect(script).toContain("OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S"); |
424 | 424 | expect(script).toContain("finalAssistant(Raw|Visible)Text"); |
425 | | -expect(script).toContain("models.providers.openai"); |
426 | | -expect(script).toContain('"timeoutSeconds":300'); |
| 425 | +expect(script).toContain("$config.models.providers"); |
| 426 | +expect(script).toContain("timeoutSeconds = 300"); |
427 | 427 | }); |
428 | 428 | |
429 | 429 | it("waits through transient Windows restoring state before VM operations", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。