test: increase live-model retry token budget for reasoning-first providers

This commit is contained in:
Peter Steinberger
2026-02-14 12:23:45 +01:00
parent 9475791d98
commit 6182d3ef85
+6 -4
View File
@@ -141,7 +141,7 @@ async function completeOkWithRetry(params: {
apiKey: string; apiKey: string;
timeoutMs: number; timeoutMs: number;
}) { }) {
const runOnce = async () => { const runOnce = async (maxTokens: number) => {
const res = await completeSimpleWithTimeout( const res = await completeSimpleWithTimeout(
params.model, params.model,
{ {
@@ -156,7 +156,7 @@ async function completeOkWithRetry(params: {
{ {
apiKey: params.apiKey, apiKey: params.apiKey,
reasoning: resolveTestReasoning(params.model), reasoning: resolveTestReasoning(params.model),
maxTokens: 64, maxTokens,
}, },
params.timeoutMs, params.timeoutMs,
); );
@@ -167,11 +167,13 @@ async function completeOkWithRetry(params: {
return { res, text }; return { res, text };
}; };
const first = await runOnce(); const first = await runOnce(64);
if (first.text.length > 0) { if (first.text.length > 0) {
return first; return first;
} }
return await runOnce(); // Some providers (for example Moonshot Kimi and MiniMax M2.5) may emit
// reasoning blocks first and only return text once token budget is higher.
return await runOnce(256);
} }
describeLive("live models (profile keys)", () => { describeLive("live models (profile keys)", () => {