@@ -57,7 +57,8 @@ const LIVE_TEST_TIMEOUT_MS = Math.max(
|
57 | 57 | 1_000, |
58 | 58 | toInt(process.env.OPENCLAW_LIVE_TEST_TIMEOUT_MS, 60 * 60 * 1000), |
59 | 59 | ); |
60 | | -const LIVE_MODEL_CONCURRENCY = Math.max(1, toInt(process.env.OPENCLAW_LIVE_MODEL_CONCURRENCY, 1)); |
| 60 | +const DEFAULT_LIVE_MODEL_CONCURRENCY = 20; |
| 61 | +const LIVE_MODEL_CONCURRENCY = resolveLiveModelConcurrency(); |
61 | 62 | const LIVE_MODELS_JSON_TIMEOUT_MS = resolveLiveModelsJsonTimeoutMs(); |
62 | 63 | const LIVE_FILE_PROBE_ENABLED = isLiveModelProbeEnabled(process.env, LIVE_MODEL_FILE_PROBE_ENV); |
63 | 64 | const LIVE_IMAGE_PROBE_ENABLED = isLiveModelProbeEnabled(process.env, LIVE_MODEL_IMAGE_PROBE_ENV); |
@@ -317,6 +318,21 @@ function toInt(value: string | undefined, fallback: number): number {
|
317 | 318 | return Number.isFinite(parsed) ? parsed : fallback; |
318 | 319 | } |
319 | 320 | |
| 321 | +function resolveLiveModelConcurrency(raw = process.env.OPENCLAW_LIVE_MODEL_CONCURRENCY): number { |
| 322 | +return Math.max(1, toInt(raw, DEFAULT_LIVE_MODEL_CONCURRENCY)); |
| 323 | +} |
| 324 | + |
| 325 | +describe("resolveLiveModelConcurrency", () => { |
| 326 | +it("defaults direct-model probes to 20-way concurrency", () => { |
| 327 | +expect(resolveLiveModelConcurrency(undefined)).toBe(20); |
| 328 | +}); |
| 329 | + |
| 330 | +it("accepts explicit concurrency overrides", () => { |
| 331 | +expect(resolveLiveModelConcurrency("7")).toBe(7); |
| 332 | +expect(resolveLiveModelConcurrency("0")).toBe(1); |
| 333 | +}); |
| 334 | +}); |
| 335 | + |
320 | 336 | function resolveLiveModelsJsonTimeoutMs( |
321 | 337 | modelsJsonTimeoutRaw = process.env.OPENCLAW_LIVE_MODELS_JSON_TIMEOUT_MS, |
322 | 338 | setupTimeoutMs = LIVE_SETUP_TIMEOUT_MS, |
|