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
This commit is contained in:
Gio Della-Libera
2026-05-18 18:46:40 -07:00
committed by GitHub
parent eb6dd2c65d
commit 88585da2e8

View File

@@ -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: {