Skip to content
TypeScript

fix(models): Claude Haiku 4.5 shows thinking on by default (#14445)

Cameron5f89a05610eb
diff --git a/apps/server/src/provider/ClaudeModelCatalog.testFixtures.ts b/apps/server/src/provider/ClaudeModelCatalog.testFixtures.ts
index 1a686b62c38..a04672d88c3 100644
--- a/apps/server/src/provider/ClaudeModelCatalog.testFixtures.ts
+++ b/apps/server/src/provider/ClaudeModelCatalog.testFixtures.ts
@@ -71,7 +71,9 @@ export const SYNTHETIC_CLAUDE_MODEL_CATALOG: ClaudeModelCatalog = {
name: "Claude Synthetic Thinking",
isCustom: false,
capabilities: {
- optionDescriptors: [{ id: "thinking", label: "Thinking", type: "boolean" }],
+ optionDescriptors: [
+ { id: "thinking", label: "Thinking", type: "boolean", currentValue: true },
+ ],
},
},
runtime: {},
diff --git a/apps/server/src/provider/model-manifest.json b/apps/server/src/provider/model-manifest.json
index 6b950ed2d06..54be975b183 100644
--- a/apps/server/src/provider/model-manifest.json
+++ b/apps/server/src/provider/model-manifest.json
@@ -1,6 +1,6 @@
{
"version": 1,
- "updatedAt": "2026-10-09T23:31:10Z",
+ "updatedAt": "2026-10-19T07:21:38Z",
"compatibility": [
{
"driver": "codex",
@@ -653,7 +653,8 @@
{
"id": "thinking",
"label": "Thinking",
- "type": "boolean"
+ "type": "boolean",
+ "currentValue": true
}
]
},
diff --git a/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts b/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts
index 6d8ee7d7a31..d6dd27e7d6e 100644
--- a/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts
+++ b/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts
@@ -224,7 +224,11 @@ it.layer(layerClaudeTextGenerationTest)("ClaudeTextGeneration", (it) => {
}),
);
- it.effect("forwards Claude thinking settings without passing unsupported effort", () =>
+ it.effect.each([
+ { thinking: true, settings: '{"disableAllHooks":true,"alwaysThinkingEnabled":true}' },
+ { thinking: false, settings: '{"disableAllHooks":true,"alwaysThinkingEnabled":false}' },
+ { thinking: undefined, settings: '{"disableAllHooks":true}' },
+ ])("forwards only the explicit thinking choice ($thinking)", ({ thinking, settings }) =>
withFakeClaudeEnv(
{
output: JSON.stringify({
@@ -233,7 +237,7 @@ it.layer(layerClaudeTextGenerationTest)("ClaudeTextGeneration", (it) => {
body: "",
},
}),
- argsMustContain: '--settings {"disableAllHooks":true,"alwaysThinkingEnabled":false}',
+ argsMustContain: `--settings ${settings}`,
argsMustNotContain: "--effort",
},
(textGeneration) =>
@@ -243,16 +247,14 @@ it.layer(layerClaudeTextGenerationTest)("ClaudeTextGeneration", (it) => {
branch: "feature/claude-effect",
stagedSummary: "M README.md",
stagedPatch: "diff --git a/README.md b/README.md",
- modelSelection: {
- ...createModelSelection(
- ProviderInstanceId.make("claudeAgent"),
- SYNTHETIC_CLAUDE_THINKING_MODEL,
- [
- { id: "thinking", value: false },
- { id: "effort", value: "high" },
- ],
- ),
- },
+ modelSelection: createModelSelection(
+ ProviderInstanceId.make("claudeAgent"),
+ SYNTHETIC_CLAUDE_THINKING_MODEL,
+ [
+ ...(thinking === undefined ? [] : [{ id: "thinking", value: thinking }]),
+ { id: "effort", value: "high" },
+ ],
+ ),
});
expect(generated.subject).toBe("Add important change");
diff --git a/apps/server/src/textGeneration/ClaudeTextGeneration.ts b/apps/server/src/textGeneration/ClaudeTextGeneration.ts
index 4e1df3067d9..b20e07e65e1 100644
--- a/apps/server/src/textGeneration/ClaudeTextGeneration.ts
+++ b/apps/server/src/textGeneration/ClaudeTextGeneration.ts
@@ -14,6 +14,7 @@ import {
toJsonSchemaObject,
} from "@t3tools/provider-core/server/textGenerationUtils";
import {
+ getModelSelectionBooleanOptionValue,
getModelSelectionStringOptionValue,
getProviderOptionDescriptors,
} from "@t3tools/shared/model";
@@ -167,8 +168,11 @@ export const makeClaudeTextGeneration = Effect.fn("makeClaudeTextGeneration")(fu
const ultracode = isClaudeCatalogUltracodeEffort(resolvedEffort);
const thinkingDescriptor = findDescriptor("thinking");
const fastModeDescriptor = findDescriptor("fastMode");
+ // Only a chosen value; otherwise Claude Code's own default applies, as in chat turns.
const thinking =
- thinkingDescriptor?.type === "boolean" ? thinkingDescriptor.currentValue : undefined;
+ thinkingDescriptor?.type === "boolean"
+ ? getModelSelectionBooleanOptionValue(resolvedModelSelection, "thinking")
+ : undefined;
const fastMode =
fastModeDescriptor?.type === "boolean" ? fastModeDescriptor.currentValue : undefined;
const settings = {