mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 12:31:24 +00:00
* Default reasoning to on when model has reasoning: true (fix #22456) What: When a model is configured with reasoning: true in openclaw.json (e.g. OpenRouter x-ai/grok-4.1-fast), the session now defaults reasoningLevel to on if the user has not set it via /reasoning or session store. Why: Users expected setting reasoning: true on the model to enable reasoning; previously only session/directive reasoningLevel was used and it always defaulted to off, so Think stayed off despite the model config. * Chore: sync formatted files from main for CI * Changelog: note zwffff/main OpenRouter fix * Changelog: fix OpenRouter entry text * Update msteams.md * Update msteams.md * Update msteams.md --------- Co-authored-by: 曾文锋0668000834 <zeng.wenfeng@xydigit.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -264,3 +264,35 @@ describe("createModelSelectionState respects session model override", () => {
|
||||
expect(state.model).toBe("deepseek-v3-4bit-mlx");
|
||||
});
|
||||
});
|
||||
|
||||
describe("createModelSelectionState resolveDefaultReasoningLevel", () => {
|
||||
it("returns on when catalog model has reasoning true", async () => {
|
||||
const { loadModelCatalog } = await import("../../agents/model-catalog.js");
|
||||
vi.mocked(loadModelCatalog).mockResolvedValueOnce([
|
||||
{ provider: "openrouter", id: "x-ai/grok-4.1-fast", name: "Grok", reasoning: true },
|
||||
]);
|
||||
const state = await createModelSelectionState({
|
||||
cfg: {} as OpenClawConfig,
|
||||
agentCfg: undefined,
|
||||
defaultProvider: "openrouter",
|
||||
defaultModel: "x-ai/grok-4.1-fast",
|
||||
provider: "openrouter",
|
||||
model: "x-ai/grok-4.1-fast",
|
||||
hasModelDirective: false,
|
||||
});
|
||||
await expect(state.resolveDefaultReasoningLevel()).resolves.toBe("on");
|
||||
});
|
||||
|
||||
it("returns off when catalog model has no reasoning", async () => {
|
||||
const state = await createModelSelectionState({
|
||||
cfg: {} as OpenClawConfig,
|
||||
agentCfg: undefined,
|
||||
defaultProvider: "openai",
|
||||
defaultModel: "gpt-4o-mini",
|
||||
provider: "openai",
|
||||
model: "gpt-4o-mini",
|
||||
hasModelDirective: false,
|
||||
});
|
||||
await expect(state.resolveDefaultReasoningLevel()).resolves.toBe("off");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user