fix(claude): resolve Sonnet 5.x to adaptive thinking so no forged thinking placeholders are sent

This commit is contained in:
Amirsalar Sojoudi authored and decolua committed 2026-10-01 10:08:40 +07:00
1 parent 7894f3d36a
commit ccd0677dc1
2 files changed
+22

No files matched your search

+1
View File
@@ -286,6 +286,7 @@ PROVIDER_CAPABILITIES.cx = PROVIDER_CAPABILITIES.codex;
export const PATTERN_CAPABILITIES = [ export const PATTERN_CAPABILITIES = [
// ── Claude (4.6+ = adaptive thinking; older/haiku = budget) ────── // ── Claude (4.6+ = adaptive thinking; older/haiku = budget) ──────
{ pattern: "*claude*opus-5*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive", contextWindow: 1000000, maxOutput: 128000 } }, { pattern: "*claude*opus-5*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive", contextWindow: 1000000, maxOutput: 128000 } },
{ pattern: "*claude*sonnet-5*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive", contextWindow: 1000000, maxOutput: 128000 } },
{ pattern: "*claude*opus-4.6*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive" } }, { pattern: "*claude*opus-4.6*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive" } },
{ pattern: "*claude*opus-4.7*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive" } }, { pattern: "*claude*opus-4.7*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive" } },
{ pattern: "*claude*opus-4.8*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive" } }, { pattern: "*claude*opus-4.8*", caps: { vision: true, reasoning: true, search: true, thinkingFormat: "claude-adaptive" } },
@@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import { getCapabilitiesForModel } from "../../open-sse/providers/capabilities.js";
// claude-sonnet-5-5 has no exact entry and matched only the generic *claude*sonnet*
// pattern (claude-budget). That sent thinking.type "enabled" and made the translator
// forge signed thinking placeholders on every tool_use turn; Sonnet 5.5 answered
// large Codex conversations with stop_reason "refusal". It must resolve like the
// rest of the 5.x family: adaptive thinking, 1M context.
describe("Claude Sonnet 5.5 capabilities", () => {
for (const model of ["claude-sonnet-5-5", "claude-sonnet-5.5", "anthropic/claude-sonnet-5-5"]) {
it(`${model} resolves to adaptive thinking + 1M context`, () => {
expect(getCapabilitiesForModel("claude", model)).toMatchObject({
thinkingFormat: "claude-adaptive",
contextWindow: 1000000,
maxOutput: 128000,
reasoning: true,
});
});
}
});