From c9e09dafc6339c60f9501230ee09cbc4114218c2 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 24 Apr 2026 05:57:50 +0100 Subject: [PATCH] test: default live model concurrency --- src/agents/models.profiles.live.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/agents/models.profiles.live.test.ts b/src/agents/models.profiles.live.test.ts index 7c9ab8cc0a4..46ce99f4fd1 100644 --- a/src/agents/models.profiles.live.test.ts +++ b/src/agents/models.profiles.live.test.ts @@ -52,6 +52,12 @@ const LIVE_SETUP_TIMEOUT_MS = Math.max( 1_000, toInt(process.env.OPENCLAW_LIVE_SETUP_TIMEOUT_MS, 45_000), ); +const LIVE_TEST_TIMEOUT_MS = Math.max( + 1_000, + toInt(process.env.OPENCLAW_LIVE_TEST_TIMEOUT_MS, 60 * 60 * 1000), +); +const DEFAULT_LIVE_MODEL_CONCURRENCY = 20; +const LIVE_MODEL_CONCURRENCY = resolveLiveModelConcurrency(); const LIVE_MODELS_JSON_TIMEOUT_MS = resolveLiveModelsJsonTimeoutMs(); const LIVE_FILE_PROBE_ENABLED = isLiveModelProbeEnabled(process.env, LIVE_MODEL_FILE_PROBE_ENV); const LIVE_IMAGE_PROBE_ENABLED = isLiveModelProbeEnabled(process.env, LIVE_MODEL_IMAGE_PROBE_ENV); @@ -311,6 +317,21 @@ function toInt(value: string | undefined, fallback: number): number { return Number.isFinite(parsed) ? parsed : fallback; } +function resolveLiveModelConcurrency(raw = process.env.OPENCLAW_LIVE_MODEL_CONCURRENCY): number { + return Math.max(1, toInt(raw, DEFAULT_LIVE_MODEL_CONCURRENCY)); +} + +describe("resolveLiveModelConcurrency", () => { + it("defaults direct-model probes to 20-way concurrency", () => { + expect(resolveLiveModelConcurrency(undefined)).toBe(20); + }); + + it("accepts explicit concurrency overrides", () => { + expect(resolveLiveModelConcurrency("7")).toBe(7); + expect(resolveLiveModelConcurrency("0")).toBe(1); + }); +}); + function resolveLiveModelsJsonTimeoutMs( modelsJsonTimeoutRaw = process.env.OPENCLAW_LIVE_MODELS_JSON_TIMEOUT_MS, setupTimeoutMs = LIVE_SETUP_TIMEOUT_MS,