mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:20:43 +00:00
test(parallels): write Windows provider config via batch file
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user