























@@ -13,6 +13,8 @@ import {
1313parseProvider,
1414modelProviderConfigBatchJson,
1515posixProviderOnlyPluginIsolationScript,
16+parsePositiveInt,
17+readPositiveIntEnv,
1618resolveParallelsModelTimeoutSeconds,
1719resolveHostIp,
1820resolveHostPort,
@@ -188,7 +190,7 @@ function parseArgs(argv: string[]): MacosOptions {
188190i++;
189191break;
190192case "--host-port":
191-options.hostPort = Number(ensureValue(argv, i, arg));
193+options.hostPort = parsePositiveInt(ensureValue(argv, i, arg), arg);
192194options.hostPortExplicit = true;
193195i++;
194196break;
@@ -241,6 +243,7 @@ function parseArgs(argv: string[]): MacosOptions {
241243}
242244243245class MacosSmoke {
246+private agentTimeoutSeconds: number;
244247private auth: ProviderAuth;
245248private discordToken = "";
246249private hostIp = "";
@@ -258,6 +261,8 @@ class MacosSmoke {
258261private discord: MacosDiscordSmoke | null = null;
259262private guestUser = "";
260263private guestTransport: "current-user" | "sudo" = "current-user";
264+private modelTimeoutSeconds: number;
265+private updateDevTimeoutSeconds: number;
261266262267private status = {
263268freshAgent: "skip",
@@ -282,6 +287,12 @@ class MacosSmoke {
282287modelId: options.modelId,
283288provider: options.provider,
284289});
290+this.agentTimeoutSeconds = readPositiveIntEnv("OPENCLAW_PARALLELS_MACOS_AGENT_TIMEOUT_S", 2700);
291+this.modelTimeoutSeconds = resolveParallelsModelTimeoutSeconds("macos");
292+this.updateDevTimeoutSeconds = readPositiveIntEnv(
293+"OPENCLAW_PARALLELS_MACOS_UPDATE_DEV_TIMEOUT_S",
294+1800,
295+);
285296this.validateDiscord();
286297}
287298@@ -475,11 +486,7 @@ class MacosSmoke {
475486this.status.freshGateway = "pass";
476487await this.phase("fresh.dashboard-load", 180, () => this.verifyDashboardLoad());
477488this.status.freshDashboard = "pass";
478-await this.phase(
479-"fresh.first-agent-turn",
480-Number(process.env.OPENCLAW_PARALLELS_MACOS_AGENT_TIMEOUT_S || 2700),
481-() => this.verifyTurn(),
482-);
489+await this.phase("fresh.first-agent-turn", this.agentTimeoutSeconds, () => this.verifyTurn());
483490this.status.freshAgent = "pass";
484491if (this.discordEnabled()) {
485492this.status.freshDiscord = "fail";
@@ -518,10 +525,8 @@ class MacosSmoke {
518525this.verifyBundlePermissions(),
519526);
520527} else {
521-await this.phase(
522-"upgrade.update-dev",
523-Number(process.env.OPENCLAW_PARALLELS_MACOS_UPDATE_DEV_TIMEOUT_S || 1800),
524-() => this.runDevChannelUpdate(),
528+await this.phase("upgrade.update-dev", this.updateDevTimeoutSeconds, () =>
529+this.runDevChannelUpdate(),
525530);
526531this.status.upgradeVersion = await this.extractLastVersion("upgrade.update-dev");
527532await this.phase("upgrade.verify-dev-channel", 60, () => this.verifyDevChannelUpdate());
@@ -532,11 +537,7 @@ class MacosSmoke {
532537this.status.upgradeGateway = "pass";
533538await this.phase("upgrade.dashboard-load", 180, () => this.verifyDashboardLoad());
534539this.status.upgradeDashboard = "pass";
535-await this.phase(
536-"upgrade.first-agent-turn",
537-Number(process.env.OPENCLAW_PARALLELS_MACOS_AGENT_TIMEOUT_S || 2700),
538-() => this.verifyTurn(),
539-);
540+await this.phase("upgrade.first-agent-turn", this.agentTimeoutSeconds, () => this.verifyTurn());
540541this.status.upgradeAgent = "pass";
541542if (this.discordEnabled()) {
542543this.status.upgradeDiscord = "fail";
@@ -1005,7 +1006,11 @@ exit 1`);
1005100610061007private verifyTurn(): void {
10071008this.guestOpenClawEntryExec(["models", "set", this.auth.modelId]);
1008-const modelProviderConfigBatch = modelProviderConfigBatchJson(this.auth.modelId, "macos");
1009+const modelProviderConfigBatch = modelProviderConfigBatchJson(
1010+this.auth.modelId,
1011+"macos",
1012+this.modelTimeoutSeconds,
1013+);
10091014if (modelProviderConfigBatch) {
10101015this.guestSh(`provider_config_batch="$(mktemp)"
10111016cat >"$provider_config_batch" <<'JSON'
@@ -1034,7 +1039,7 @@ for attempt in 1 2; do
10341039 set +e
10351040 /usr/bin/env ${shellQuote(`${this.auth.apiKeyEnv}=${this.auth.apiKeyValue}`)} ${guestOpenClawEntryRunner} agent --local --agent main --session-id "$session_id" --message ${shellQuote(
10361041 "Reply with exact ASCII text OK only.",
1037- )} --thinking off --timeout ${resolveParallelsModelTimeoutSeconds("macos")} --json >"$output_file" 2>&1
1042+ )} --thinking off --timeout ${this.modelTimeoutSeconds} --json >"$output_file" 2>&1
10381043 rc=$?
10391044 set -e
10401045 cat "$output_file"
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。