File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,8 +20,20 @@ export function windowsModelProviderTimeoutScript(modelId: string): string {
2020 if ( ! providerId || ! configJson ) {
2121 return "" ;
2222 }
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" }` ;
2537}
2638
2739export const windowsOpenClawResolver = String . raw `function Resolve-OpenClawCommand {
Original file line number Diff line number Diff line change @@ -324,6 +324,7 @@ console.log(JSON.stringify(result));
324324 expect ( readFileSync ( TS_PATHS . macos , "utf8" ) ) . toContain ( "providerTimeoutConfigJson" ) ;
325325 expect ( readFileSync ( TS_PATHS . linux , "utf8" ) ) . toContain ( "providerTimeoutConfigJson" ) ;
326326 expect ( readFileSync ( TS_PATHS . windows , "utf8" ) ) . toContain ( "windowsModelProviderTimeoutScript" ) ;
327+ expect ( readFileSync ( TS_PATHS . powershell , "utf8" ) ) . toContain ( "config set --batch-file" ) ;
327328
328329 const npmUpdateScripts = readFileSync ( TS_PATHS . npmUpdateScripts , "utf8" ) ;
329330 expect ( npmUpdateScripts ) . toContain ( "posixAgentWorkspaceScript" ) ;
You can’t perform that action at this time.
0 commit comments