mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 23:00:22 +00:00
fix(agents): prioritize per-model thinking defaults (#30439)
* fix(agents): honor per-model thinking defaults * fix(agents): preserve thinking fallback with model defaults --------- Co-authored-by: Mark L <73659136+markliuyuxiang@users.noreply.github.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
modelKey,
|
||||
resolveAllowedModelRef,
|
||||
resolveConfiguredModelRef,
|
||||
resolveThinkingDefault,
|
||||
resolveModelRefFromString,
|
||||
} from "./model-selection.js";
|
||||
|
||||
@@ -470,6 +471,39 @@ describe("model-selection", () => {
|
||||
expect(result).toEqual({ provider: "openai", model: "gpt-4" });
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveThinkingDefault", () => {
|
||||
it("prefers per-model params.thinking over global thinkingDefault", () => {
|
||||
const cfg = {
|
||||
agents: {
|
||||
defaults: {
|
||||
thinkingDefault: "low",
|
||||
models: {
|
||||
"anthropic/claude-opus-4-6": {
|
||||
params: { thinking: "high" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} 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("high");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeModelSelection", () => {
|
||||
|
||||
Reference in New Issue
Block a user