mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:20:43 +00:00
test: default live model concurrency
This commit is contained in:
@@ -53,7 +53,7 @@ Live tests are split into two layers so we can isolate failures:
|
||||
- or `OPENCLAW_LIVE_MODELS="openai/gpt-5.2,openai-codex/gpt-5.2,anthropic/claude-opus-4-6,..."` (comma allowlist)
|
||||
- Modern/all sweeps default to a curated high-signal cap; set `OPENCLAW_LIVE_MAX_MODELS=0` for an exhaustive modern sweep or a positive number for a smaller cap.
|
||||
- Exhaustive sweeps use `OPENCLAW_LIVE_TEST_TIMEOUT_MS` for the whole direct-model test timeout. Default: 60 minutes.
|
||||
- Set `OPENCLAW_LIVE_MODEL_CONCURRENCY=20` to run direct-model probes in parallel. Default: 1.
|
||||
- Direct-model probes run with 20-way parallelism by default; set `OPENCLAW_LIVE_MODEL_CONCURRENCY` to override.
|
||||
- How to select providers:
|
||||
- `OPENCLAW_LIVE_PROVIDERS="google,google-antigravity,google-gemini-cli"` (comma allowlist)
|
||||
- Where keys come from:
|
||||
|
||||
@@ -57,7 +57,8 @@ const LIVE_TEST_TIMEOUT_MS = Math.max(
|
||||
1_000,
|
||||
toInt(process.env.OPENCLAW_LIVE_TEST_TIMEOUT_MS, 60 * 60 * 1000),
|
||||
);
|
||||
const LIVE_MODEL_CONCURRENCY = Math.max(1, toInt(process.env.OPENCLAW_LIVE_MODEL_CONCURRENCY, 1));
|
||||
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);
|
||||
@@ -317,6 +318,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,
|
||||
|
||||
Reference in New Issue
Block a user