diff --git a/scripts/e2e/parallels/powershell.ts b/scripts/e2e/parallels/powershell.ts index deb8fdd67de..d8ed66ad567 100644 --- a/scripts/e2e/parallels/powershell.ts +++ b/scripts/e2e/parallels/powershell.ts @@ -20,8 +20,20 @@ export function windowsModelProviderTimeoutScript(modelId: string): string { if (!providerId || !configJson) { return ""; } - return `Invoke-OpenClaw config set ${psSingleQuote(`models.providers.${providerId}`)} ${psSingleQuote(configJson)} --strict-json -if ($LASTEXITCODE -ne 0) { throw "model provider timeout config set failed" }`; + const batchJson = JSON.stringify([ + { + path: `models.providers.${providerId}`, + value: JSON.parse(configJson) as unknown, + }, + ]); + return `$providerTimeoutBatchPath = Join-Path ([System.IO.Path]::GetTempPath()) 'openclaw-provider-timeout.batch.json' +@' +${batchJson} +'@ | Set-Content -Path $providerTimeoutBatchPath -Encoding UTF8 +Invoke-OpenClaw config set --batch-file $providerTimeoutBatchPath --strict-json +$providerTimeoutExit = $LASTEXITCODE +Remove-Item $providerTimeoutBatchPath -Force -ErrorAction SilentlyContinue +if ($providerTimeoutExit -ne 0) { throw "model provider timeout config set failed" }`; } export const windowsOpenClawResolver = String.raw`function Resolve-OpenClawCommand { diff --git a/test/scripts/parallels-smoke-model.test.ts b/test/scripts/parallels-smoke-model.test.ts index 9ed25024c84..d94b7b37aa8 100644 --- a/test/scripts/parallels-smoke-model.test.ts +++ b/test/scripts/parallels-smoke-model.test.ts @@ -324,6 +324,7 @@ console.log(JSON.stringify(result)); expect(readFileSync(TS_PATHS.macos, "utf8")).toContain("providerTimeoutConfigJson"); expect(readFileSync(TS_PATHS.linux, "utf8")).toContain("providerTimeoutConfigJson"); expect(readFileSync(TS_PATHS.windows, "utf8")).toContain("windowsModelProviderTimeoutScript"); + expect(readFileSync(TS_PATHS.powershell, "utf8")).toContain("config set --batch-file"); const npmUpdateScripts = readFileSync(TS_PATHS.npmUpdateScripts, "utf8"); expect(npmUpdateScripts).toContain("posixAgentWorkspaceScript");