test(parallels): write Windows provider config via batch file · openclaw/openclaw@efe6b37
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,8 +20,20 @@ export function windowsModelProviderTimeoutScript(modelId: string): string {
|
20 | 20 | if (!providerId || !configJson) { |
21 | 21 | return ""; |
22 | 22 | } |
23 | | -return `Invoke-OpenClaw config set ${psSingleQuote(`models.providers.${providerId}`)} ${psSingleQuote(configJson)} --strict-json |
24 | | -if ($LASTEXITCODE -ne 0) { throw "model provider timeout config set failed" }`; |
| 23 | +const batchJson = JSON.stringify([ |
| 24 | +{ |
| 25 | +path: `models.providers.${providerId}`, |
| 26 | +value: JSON.parse(configJson) as unknown, |
| 27 | +}, |
| 28 | +]); |
| 29 | +return `$providerTimeoutBatchPath = Join-Path ([System.IO.Path]::GetTempPath()) 'openclaw-provider-timeout.batch.json' |
| 30 | +@' |
| 31 | +${batchJson} |
| 32 | +'@ | Set-Content -Path $providerTimeoutBatchPath -Encoding UTF8 |
| 33 | +Invoke-OpenClaw config set --batch-file $providerTimeoutBatchPath --strict-json |
| 34 | +$providerTimeoutExit = $LASTEXITCODE |
| 35 | +Remove-Item $providerTimeoutBatchPath -Force -ErrorAction SilentlyContinue |
| 36 | +if ($providerTimeoutExit -ne 0) { throw "model provider timeout config set failed" }`; |
25 | 37 | } |
26 | 38 | |
27 | 39 | export const windowsOpenClawResolver = String.raw`function Resolve-OpenClawCommand { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。