From 88585da2e8123d921377fff63d4b7227b76ca2b5 Mon Sep 17 00:00:00 2001 From: Gio Della-Libera Date: Mon, 18 May 2026 18:46:40 -0700 Subject: [PATCH] test(config): keep agent model overrides selection-only (#83319) * fix(config): keep subagent model overrides selection-only * fix(config): reuse agent model schema for subagents --- src/config/schema.test.ts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/config/schema.test.ts b/src/config/schema.test.ts index 050b42ee7d90..0602fbafe5cd 100644 --- a/src/config/schema.test.ts +++ b/src/config/schema.test.ts @@ -390,6 +390,44 @@ describe("config schema", () => { ).toBe(false); }); + it("keeps per-agent model overrides limited to model selection", () => { + const result = OpenClawSchema.safeParse({ + agents: { + list: [ + { + id: "main", + model: { + primary: "openai/gpt-5.5", + timeoutMs: 30_000, + }, + }, + ], + }, + }); + + expect(result.success).toBe(false); + }); + + it("rejects per-agent subagent model timeout config", () => { + const result = OpenClawSchema.safeParse({ + agents: { + list: [ + { + id: "main", + subagents: { + model: { + primary: "openai/gpt-5.5", + timeoutMs: 30_000, + }, + }, + }, + ], + }, + }); + + expect(result.success).toBe(false); + }); + it("accepts exec command highlighting config in global and agent scopes", () => { const tools = ToolsSchema.parse({ exec: {