Skip to content

Commit 79b4ebd

Browse files
committed
test(model): cover fallback reasoning propagation
1 parent f39883c commit 79b4ebd

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/agents/pi-embedded-runner/model.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,32 @@ describe("resolveModel", () => {
200200
expect(result.model?.maxTokens).toBe(32768);
201201
});
202202

203+
it("propagates reasoning from matching configured fallback model", () => {
204+
const cfg = {
205+
models: {
206+
providers: {
207+
custom: {
208+
baseUrl: "http://localhost:9000",
209+
models: [
210+
{
211+
...makeModel("model-a"),
212+
reasoning: false,
213+
},
214+
{
215+
...makeModel("model-b"),
216+
reasoning: true,
217+
},
218+
],
219+
},
220+
},
221+
},
222+
} as OpenClawConfig;
223+
224+
const result = resolveModel("custom", "model-b", "/tmp/agent", cfg);
225+
226+
expect(result.model?.reasoning).toBe(true);
227+
});
228+
203229
it("builds an openai-codex fallback for gpt-5.3-codex", () => {
204230
mockOpenAICodexTemplateModel();
205231

0 commit comments

Comments
 (0)