From 1191e8416a161b5ec4c80ac07f972fcaf8635ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 24 Oct 2026 18:47:03 +0200 Subject: [PATCH] test(labs): expect the minimum's thinking room on wires that cannot promise off The lab-scan read asks every provider for no reasoning. On an OpenAI-compatible gateway or a local server that "none" is a request the model behind it may ignore, so these wires now add the low thinking budget on top, the same rule the file already holds for a model that always thinks: the answer keeps its full allowance either way. Refs #1276 --- src/lib/labs/__tests__/ocr-output-budget.test.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/labs/__tests__/ocr-output-budget.test.ts b/src/lib/labs/__tests__/ocr-output-budget.test.ts index fd5d17cd9..b57abe8c9 100644 --- a/src/lib/labs/__tests__/ocr-output-budget.test.ts +++ b/src/lib/labs/__tests__/ocr-output-budget.test.ts @@ -115,8 +115,12 @@ describe("OpenAI", () => { }); }); +// #1276 — a gateway or local server cannot promise that `none` is honoured +// (a model behind it may reason anyway), so these wires add the minimum's +// thinking budget on top like a model that always thinks: the answer keeps +// its full allowance either way. describe("an OpenAI-compatible gateway (Gemini, OpenRouter, LiteLLM)", () => { - it("asks for no reasoning on the endpoint's own dialect", async () => { + it("asks for no reasoning on the endpoint's own dialect, with the minimum's budget on top", async () => { const body = await sentBody( new OpenAIClient({ apiKey: "k", @@ -126,12 +130,14 @@ describe("an OpenAI-compatible gateway (Gemini, OpenRouter, LiteLLM)", () => { }), ); expect(body.reasoning_effort).toBe("none"); - expect(body.max_tokens ?? body.max_completion_tokens).toBe(ANSWER); + expect(body.max_tokens ?? body.max_completion_tokens).toBe( + ANSWER + REASONING_THINKING_BUDGET.low, + ); }); }); describe("a local server", () => { - it("asks for no reasoning and keeps the answer budget", async () => { + it("asks for no reasoning and keeps the answer budget, with the minimum's on top", async () => { const body = await sentBody( new LocalOpenAICompatibleClient({ apiKey: null, @@ -140,7 +146,7 @@ describe("a local server", () => { }), ); expect(body.reasoning_effort).toBe("none"); - expect(body.max_tokens).toBe(ANSWER); + expect(body.max_tokens).toBe(ANSWER + REASONING_THINKING_BUDGET.low); }); });