Skip to content

Commit 892602e

Browse files
committed
test(live): harden ARM live harness defaults
1 parent 79a8dec commit 892602e

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/agents/embedded-agent-runner.anthropic-tool-replay.live.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import {
1010
import { isLiveTestEnabled } from "./live-test-helpers.js";
1111
import { buildAssistantMessageWithZeroUsage } from "./stream-message-shared.js";
1212

13-
const ANTHROPIC_LIVE = isLiveTestEnabled(["ANTHROPIC_LIVE_TEST"]);
13+
const ANTHROPIC_LIVE =
14+
isLiveTestEnabled(["ANTHROPIC_LIVE_TEST"]) &&
15+
(process.env.ANTHROPIC_API_KEY ?? "").trim().length > 0;
1416
const describeLive = ANTHROPIC_LIVE ? describe : describe.skip;
1517
const ANTHROPIC_TIMEOUT_MS = 120_000;
1618
const TOOL_OUTPUT_SENTINEL = "TOOL-RESULT-LIVE-MAGENTA";

src/gateway/gateway-models.profiles.live.test.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ const GATEWAY_LIVE_PROBE_TIMEOUT_MS = Math.max(
8585
30_000,
8686
toInt(process.env.OPENCLAW_LIVE_GATEWAY_STEP_TIMEOUT_MS, 90_000),
8787
);
88-
const GATEWAY_LIVE_SETUP_TIMEOUT_MS = Math.max(
89-
1_000,
90-
toInt(process.env.OPENCLAW_LIVE_GATEWAY_SETUP_TIMEOUT_MS, 60_000),
91-
);
88+
const GATEWAY_LIVE_SETUP_TIMEOUT_MS = resolveGatewayLiveSetupTimeoutMs();
9289
const GATEWAY_LIVE_MODEL_TIMEOUT_MS = resolveGatewayLiveModelTimeoutMs();
9390
const GATEWAY_LIVE_SESSION_CONTROL_TIMEOUT_MS = resolveGatewayLiveSessionControlTimeoutMs();
9491
const GATEWAY_LIVE_TRANSCRIPT_TIMEOUT_MS = resolveGatewayLiveTranscriptTimeoutMs();
@@ -214,6 +211,12 @@ function toInt(value: string | undefined, fallback: number): number {
214211
return Number.isFinite(parsed) ? parsed : fallback;
215212
}
216213

214+
function resolveGatewayLiveSetupTimeoutMs(
215+
raw = process.env.OPENCLAW_LIVE_GATEWAY_SETUP_TIMEOUT_MS,
216+
): number {
217+
return Math.max(1_000, toInt(raw, 180_000));
218+
}
219+
217220
function resolveGatewayLiveMaxModels(): number {
218221
const gatewayRaw = process.env.OPENCLAW_LIVE_GATEWAY_MAX_MODELS?.trim();
219222
if (gatewayRaw) {
@@ -755,6 +758,14 @@ describe("resolveGatewayLiveTranscriptTimeoutMs", () => {
755758
});
756759

757760
describe("gateway live timeout floors", () => {
761+
it("defaults setup budget above slow ARM model discovery", () => {
762+
expect(resolveGatewayLiveSetupTimeoutMs("")).toBe(180_000);
763+
});
764+
765+
it("keeps explicit shorter setup budgets available for targeted probes", () => {
766+
expect(resolveGatewayLiveSetupTimeoutMs("60000")).toBe(60_000);
767+
});
768+
758769
it("never goes below the probe timeout", () => {
759770
expect(resolveGatewayLiveModelTimeoutMs("45000", undefined, 90_000)).toBe(90_000);
760771
expect(resolveGatewayLiveTranscriptTimeoutMs(240_000, 180_000)).toBe(240_000);

0 commit comments

Comments
 (0)