fix provider thinking compatibility

- claude: handle DeepSeek thinking blocks defensively, unsigned placeholder; fix kept-vs-seen thinking detection
- gemini: clamp unsupported max/xhigh thinking levels to high
- testUtils: probe Cloud Code Assist for gemini-cli/antigravity with 401 refresh retry
- tests: add translator regression coverage

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Mink Nguyen
2026-06-26 10:12:48 +07:00
committed by decolua
co-authored by Cursor
parent cb65a45e1f
commit c4f80d30d8
5 changed files with 140 additions and 17 deletions
+10
View File
@@ -68,6 +68,16 @@ describe("applyThinking per provider format", () => {
const out = apply("gemini", "gemini-3-pro", { reasoning_effort: "medium" }, "gemini");
expect(out.generationConfig.thinkingConfig.thinkingLevel).toBe("medium");
});
it("gemini-3 clamps unsupported max/xhigh thinking levels to high", () => {
const outMax = apply("gemini", "gemini-3-pro", { reasoning_effort: "max" }, "gemini");
const outXhigh = apply("gemini", "gemini-3-pro", { reasoning_effort: "xhigh" }, "gemini");
expect(outMax.generationConfig.thinkingConfig.thinkingLevel).toBe("high");
expect(outXhigh.generationConfig.thinkingConfig.thinkingLevel).toBe("high");
});
it("gemini-3 maps auto thinking level to high instead of sending unsupported auto", () => {
const out = apply("gemini", "gemini-3-pro", { reasoning_effort: "auto" }, "gemini");
expect(out.generationConfig.thinkingConfig.thinkingLevel).toBe("high");
});
it("gemini-2.5 → thinkingBudget", () => {
const out = apply("gemini", "gemini-2.5-flash", { reasoning_effort: "high" }, "gemini");
expect(out.generationConfig.thinkingConfig.thinkingBudget).toBe(24576);