mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 06:57:26 +00:00
test: stabilize docker live model suites
This commit is contained in:
@@ -496,7 +496,10 @@ describeLive("live models (profile keys)", () => {
|
|||||||
throw new Error(msg || "model returned error with no message");
|
throw new Error(msg || "model returned error with no message");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok.text.length === 0 && model.provider === "google") {
|
if (
|
||||||
|
ok.text.length === 0 &&
|
||||||
|
(model.provider === "google" || model.provider === "google-gemini-cli")
|
||||||
|
) {
|
||||||
skipped.push({
|
skipped.push({
|
||||||
model: id,
|
model: id,
|
||||||
reason: "no text returned (likely unavailable model id)",
|
reason: "no text returned (likely unavailable model id)",
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ const THINKING_LEVEL = "high";
|
|||||||
const THINKING_TAG_RE = /<\s*\/?\s*(?:think(?:ing)?|thought|antthinking)\s*>/i;
|
const THINKING_TAG_RE = /<\s*\/?\s*(?:think(?:ing)?|thought|antthinking)\s*>/i;
|
||||||
const FINAL_TAG_RE = /<\s*\/?\s*final\s*>/i;
|
const FINAL_TAG_RE = /<\s*\/?\s*final\s*>/i;
|
||||||
const ANTHROPIC_MAGIC_STRING_TRIGGER_REFUSAL = "ANTHROPIC_MAGIC_STRING_TRIGGER_REFUSAL";
|
const ANTHROPIC_MAGIC_STRING_TRIGGER_REFUSAL = "ANTHROPIC_MAGIC_STRING_TRIGGER_REFUSAL";
|
||||||
|
const GATEWAY_LIVE_DEFAULT_TIMEOUT_MS = 20 * 60 * 1000;
|
||||||
|
const GATEWAY_LIVE_UNBOUNDED_TIMEOUT_MS = 60 * 60 * 1000;
|
||||||
|
const GATEWAY_LIVE_MAX_TIMEOUT_MS = 2 * 60 * 60 * 1000;
|
||||||
|
const GATEWAY_LIVE_MAX_MODELS = resolveGatewayLiveMaxModels();
|
||||||
|
const GATEWAY_LIVE_SUITE_TIMEOUT_MS = resolveGatewayLiveSuiteTimeoutMs(GATEWAY_LIVE_MAX_MODELS);
|
||||||
|
|
||||||
const describeLive = LIVE || GATEWAY_LIVE ? describe : describe.skip;
|
const describeLive = LIVE || GATEWAY_LIVE ? describe : describe.skip;
|
||||||
|
|
||||||
@@ -64,6 +69,27 @@ function toInt(value: string | undefined, fallback: number): number {
|
|||||||
return Number.isFinite(parsed) ? parsed : fallback;
|
return Number.isFinite(parsed) ? parsed : fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resolveGatewayLiveMaxModels(): number {
|
||||||
|
const gatewayMax = toInt(process.env.OPENCLAW_LIVE_GATEWAY_MAX_MODELS, -1);
|
||||||
|
if (gatewayMax >= 0) {
|
||||||
|
return gatewayMax;
|
||||||
|
}
|
||||||
|
// Reuse shared live-model cap when gateway-specific cap is not provided.
|
||||||
|
return Math.max(0, toInt(process.env.OPENCLAW_LIVE_MAX_MODELS, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveGatewayLiveSuiteTimeoutMs(maxModels: number): number {
|
||||||
|
if (maxModels <= 0) {
|
||||||
|
return GATEWAY_LIVE_UNBOUNDED_TIMEOUT_MS;
|
||||||
|
}
|
||||||
|
// Gateway live runs multiple probes per model; scale timeout by model cap.
|
||||||
|
const estimated = 5 * 60 * 1000 + maxModels * 90 * 1000;
|
||||||
|
return Math.max(
|
||||||
|
GATEWAY_LIVE_DEFAULT_TIMEOUT_MS,
|
||||||
|
Math.min(GATEWAY_LIVE_MAX_TIMEOUT_MS, estimated),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function capByProviderSpread<T>(
|
function capByProviderSpread<T>(
|
||||||
items: T[],
|
items: T[],
|
||||||
maxItems: number,
|
maxItems: number,
|
||||||
@@ -1144,7 +1170,7 @@ describeLive("gateway live (dev agent, profile keys)", () => {
|
|||||||
const useModern = !rawModels || rawModels === "modern" || rawModels === "all";
|
const useModern = !rawModels || rawModels === "modern" || rawModels === "all";
|
||||||
const useExplicit = Boolean(rawModels) && !useModern;
|
const useExplicit = Boolean(rawModels) && !useModern;
|
||||||
const filter = useExplicit ? parseFilter(rawModels) : null;
|
const filter = useExplicit ? parseFilter(rawModels) : null;
|
||||||
const maxModels = toInt(process.env.OPENCLAW_LIVE_GATEWAY_MAX_MODELS, 0);
|
const maxModels = GATEWAY_LIVE_MAX_MODELS;
|
||||||
const wanted = filter
|
const wanted = filter
|
||||||
? all.filter((m) => filter.has(`${m.provider}/${m.id}`))
|
? all.filter((m) => filter.has(`${m.provider}/${m.id}`))
|
||||||
: all.filter((m) => isModernModelRef({ provider: m.provider, id: m.id }));
|
: all.filter((m) => isModernModelRef({ provider: m.provider, id: m.id }));
|
||||||
@@ -1224,7 +1250,7 @@ describeLive("gateway live (dev agent, profile keys)", () => {
|
|||||||
logProgress("[minimax-anthropic] missing minimax provider config; skipping");
|
logProgress("[minimax-anthropic] missing minimax provider config; skipping");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
20 * 60 * 1000,
|
GATEWAY_LIVE_SUITE_TIMEOUT_MS,
|
||||||
);
|
);
|
||||||
|
|
||||||
it("z.ai fallback handles anthropic tool history", async () => {
|
it("z.ai fallback handles anthropic tool history", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user