fix(thinking): default Claude 4.6 to adaptive

This commit is contained in:
Peter Steinberger
2026-03-02 04:27:26 +00:00
parent 4691aab019
commit 37d036714e
4 changed files with 103 additions and 1 deletions

View File

@@ -503,6 +503,72 @@ describe("model-selection", () => {
}),
).toBe("high");
});
it("accepts per-model params.thinking=adaptive", () => {
const cfg = {
agents: {
defaults: {
models: {
"anthropic/claude-opus-4-6": {
params: { thinking: "adaptive" },
},
},
},
},
} as OpenClawConfig;
expect(
resolveThinkingDefault({
cfg,
provider: "anthropic",
model: "claude-opus-4-6",
catalog: [
{
provider: "anthropic",
id: "claude-opus-4-6",
name: "Claude Opus 4.6",
reasoning: true,
},
],
}),
).toBe("adaptive");
});
it("defaults Anthropic Claude 4.6 models to adaptive", () => {
const cfg = {} as OpenClawConfig;
expect(
resolveThinkingDefault({
cfg,
provider: "anthropic",
model: "claude-opus-4-6",
catalog: [
{
provider: "anthropic",
id: "claude-opus-4-6",
name: "Claude Opus 4.6",
reasoning: true,
},
],
}),
).toBe("adaptive");
expect(
resolveThinkingDefault({
cfg,
provider: "amazon-bedrock",
model: "us.anthropic.claude-sonnet-4-6-v1:0",
catalog: [
{
provider: "amazon-bedrock",
id: "us.anthropic.claude-sonnet-4-6-v1:0",
name: "Claude Sonnet 4.6",
reasoning: true,
},
],
}),
).toBe("adaptive");
});
});
});