From 38e03d3af32e1ccc0c2bee209b7f823aa34be734 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 09:46:12 +0100 Subject: [PATCH] test: extend Parallels model smoke timeout --- scripts/e2e/parallels/linux-smoke.ts | 10 ++++++++++ scripts/e2e/parallels/macos-smoke.ts | 10 ++++++++++ scripts/e2e/parallels/npm-update-scripts.ts | 8 +++++++- scripts/e2e/parallels/npm-update-smoke.ts | 1 + scripts/e2e/parallels/windows-smoke.ts | 4 ++++ test/scripts/parallels-smoke-model.test.ts | 4 ++++ 6 files changed, 36 insertions(+), 1 deletion(-) diff --git a/scripts/e2e/parallels/linux-smoke.ts b/scripts/e2e/parallels/linux-smoke.ts index 257fe2c80cc..c4eb1bb7541 100755 --- a/scripts/e2e/parallels/linux-smoke.ts +++ b/scripts/e2e/parallels/linux-smoke.ts @@ -101,6 +101,8 @@ const defaultOptions = (): LinuxOptions => ({ vmNameExplicit: false, }); +const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300); + function usage(): string { return `Usage: bash scripts/e2e/parallels-linux-smoke.sh [options] @@ -672,6 +674,14 @@ rm -rf /root/.openclaw/test-bad-plugin`); private verifyLocalTurn(): void { this.guestExec(["openclaw", "models", "set", this.auth.modelId]); + this.guestExec([ + "openclaw", + "config", + "set", + `models.providers.${this.options.provider}.timeoutSeconds`, + String(agentModelTimeoutSeconds), + "--strict-json", + ]); this.guestExec([ "openclaw", "config", diff --git a/scripts/e2e/parallels/macos-smoke.ts b/scripts/e2e/parallels/macos-smoke.ts index bcc0d86ba1b..7cf42649b34 100755 --- a/scripts/e2e/parallels/macos-smoke.ts +++ b/scripts/e2e/parallels/macos-smoke.ts @@ -95,6 +95,7 @@ const guestOpenClaw = "/opt/homebrew/bin/openclaw"; const guestOpenClawEntry = "/opt/homebrew/lib/node_modules/openclaw/openclaw.mjs"; const guestNode = "/opt/homebrew/bin/node"; const guestNpm = "/opt/homebrew/bin/npm"; +const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300); const defaultOptions = (): MacosOptions => ({ discordChannelId: undefined, @@ -963,6 +964,15 @@ exit 1`); private verifyTurn(): void { this.guestExec([guestNode, guestOpenClawEntry, "models", "set", this.auth.modelId]); + this.guestExec([ + guestNode, + guestOpenClawEntry, + "config", + "set", + `models.providers.${this.options.provider}.timeoutSeconds`, + String(agentModelTimeoutSeconds), + "--strict-json", + ]); this.guestExec([ guestNode, guestOpenClawEntry, diff --git a/scripts/e2e/parallels/npm-update-scripts.ts b/scripts/e2e/parallels/npm-update-scripts.ts index e595a93592c..388a181f4a1 100644 --- a/scripts/e2e/parallels/npm-update-scripts.ts +++ b/scripts/e2e/parallels/npm-update-scripts.ts @@ -1,14 +1,17 @@ import { posixAgentWorkspaceScript, windowsAgentWorkspaceScript } from "./agent-workspace.ts"; import { shellQuote } from "./host-command.ts"; import { psSingleQuote, windowsOpenClawResolver } from "./powershell.ts"; -import type { ProviderAuth } from "./types.ts"; +import type { Provider, ProviderAuth } from "./types.ts"; export interface NpmUpdateScriptInput { auth: ProviderAuth; expectedNeedle: string; + provider: Provider; updateTarget: string; } +const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300); + export function macosUpdateScript(input: NpmUpdateScriptInput): string { return String.raw`set -euo pipefail export PATH=/opt/homebrew/bin:/opt/homebrew/opt/node/bin:/opt/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin @@ -70,6 +73,7 @@ ${posixVersionCheck("/opt/homebrew/bin/openclaw", input.expectedNeedle)} start_openclaw_gateway wait_for_gateway /opt/homebrew/bin/openclaw models set ${shellQuote(input.auth.modelId)} +/opt/homebrew/bin/openclaw config set models.providers.${input.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json /opt/homebrew/bin/openclaw config set agents.defaults.skipBootstrap true --strict-json ${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.")} ${input.auth.apiKeyEnv}=${shellQuote(input.auth.apiKeyValue)} /opt/homebrew/bin/openclaw agent --local --agent main --session-id parallels-npm-update-macos --message 'Reply with exact ASCII text OK only.' --json`; @@ -140,6 +144,7 @@ if ($LASTEXITCODE -ne 0) { } Wait-OpenClawGateway Invoke-OpenClaw models set ${psSingleQuote(input.auth.modelId)} +Invoke-OpenClaw config set models.providers.${input.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json ${windowsAgentWorkspaceScript("Parallels npm update smoke test assistant.")} Set-Item -Path ('Env:' + ${psSingleQuote(input.auth.apiKeyEnv)}) -Value ${psSingleQuote(input.auth.apiKeyValue)} @@ -202,6 +207,7 @@ ${posixVersionCheck("openclaw", input.expectedNeedle)} start_openclaw_gateway wait_for_gateway openclaw models set ${shellQuote(input.auth.modelId)} +openclaw config set models.providers.${input.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json openclaw config set agents.defaults.skipBootstrap true --strict-json ${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.")} ${input.auth.apiKeyEnv}=${shellQuote(input.auth.apiKeyValue)} openclaw agent --local --agent main --session-id parallels-npm-update-linux --message 'Reply with exact ASCII text OK only.' --json`; diff --git a/scripts/e2e/parallels/npm-update-smoke.ts b/scripts/e2e/parallels/npm-update-smoke.ts index 5a00c619762..f1dadc4fdda 100755 --- a/scripts/e2e/parallels/npm-update-smoke.ts +++ b/scripts/e2e/parallels/npm-update-smoke.ts @@ -378,6 +378,7 @@ class NpmUpdateSmoke { const input = { auth: this.auth, expectedNeedle: this.updateExpectedNeedle, + provider: this.options.provider, updateTarget: this.updateTargetEffective, }; switch (platform) { diff --git a/scripts/e2e/parallels/windows-smoke.ts b/scripts/e2e/parallels/windows-smoke.ts index c7812787a69..29e52c68759 100755 --- a/scripts/e2e/parallels/windows-smoke.ts +++ b/scripts/e2e/parallels/windows-smoke.ts @@ -102,6 +102,8 @@ const defaultOptions = (): WindowsOptions => ({ vmName: "Windows 11", }); +const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300); + function usage(): string { return `Usage: bash scripts/e2e/parallels-windows-smoke.sh [options] @@ -879,6 +881,8 @@ if ($LASTEXITCODE -ne 0) { throw "gateway ${action} failed with exit code $LASTE $PSNativeCommandUseErrorActionPreference = $false Invoke-OpenClaw models set ${psSingleQuote(this.auth.modelId)} if ($LASTEXITCODE -ne 0) { throw "models set failed" } +Invoke-OpenClaw config set models.providers.${this.options.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json +if ($LASTEXITCODE -ne 0) { throw "provider timeout config set failed" } Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json if ($LASTEXITCODE -ne 0) { throw "config set failed" } ${windowsAgentWorkspaceScript("Parallels Windows smoke test assistant.")} diff --git a/test/scripts/parallels-smoke-model.test.ts b/test/scripts/parallels-smoke-model.test.ts index 997fb77f162..3259af2f5cf 100644 --- a/test/scripts/parallels-smoke-model.test.ts +++ b/test/scripts/parallels-smoke-model.test.ts @@ -283,11 +283,15 @@ console.log(resolveUbuntuVmName("Ubuntu missing")); expect(script, scriptPath).toContain("AgentWorkspaceScript"); expect(script, scriptPath).toContain("parallels-"); expect(script, scriptPath).toContain("agents.defaults.skipBootstrap"); + expect(script, scriptPath).toContain("OPENCLAW_PARALLELS_MODEL_TIMEOUT_S"); + expect(script, scriptPath).toContain("timeoutSeconds"); } const npmUpdateScripts = readFileSync(TS_PATHS.npmUpdateScripts, "utf8"); expect(npmUpdateScripts).toContain("posixAgentWorkspaceScript"); expect(npmUpdateScripts).toContain("windowsAgentWorkspaceScript"); + expect(npmUpdateScripts).toContain("OPENCLAW_PARALLELS_MODEL_TIMEOUT_S"); + expect(npmUpdateScripts).toContain("timeoutSeconds"); }); it("clears phase timers and applies phase deadlines to guest commands", () => {