Skip to content

Commit b72c877

Browse files
atian8179altaywtf
andauthored
fix(config): add missing params field to agents.list[] validation schema (openclaw#41171)
Merged via squash. Prepared head SHA: 9522761 Co-authored-by: atian8179 <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
1 parent f9ea879 commit b72c877

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Docs: https://docs.openclaw.ai
1919
- Agents/memory bootstrap: load only one root memory file, preferring `MEMORY.md` and using `memory.md` as a fallback, so case-insensitive Docker mounts no longer inject duplicate memory context. (#26054) Thanks @Lanfei.
2020
- Agents/OpenAI-compatible compat overrides: respect explicit user `models[].compat` opt-ins for non-native `openai-completions` endpoints so usage-in-streaming capability overrides no longer get forced off when the endpoint actually supports them. (#44432) Thanks @cheapestinference.
2121
- Agents/Azure OpenAI startup prompts: rephrase the built-in `/new`, `/reset`, and post-compaction startup instruction so Azure OpenAI deployments no longer hit HTTP 400 false positives from the content filter. (#43403) Thanks @xingsy97.
22+
- Config/validation: accept documented `agents.list[].params` per-agent overrides in strict config validation so `openclaw config validate` no longer rejects runtime-supported `cacheRetention`, `temperature`, and `maxTokens` settings. (#41171) Thanks @atian8179.
2223

2324
## 2026.3.12
2425

src/config/config-misc.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,33 @@ describe("config strict validation", () => {
361361
expect(res.ok).toBe(false);
362362
});
363363

364+
it("accepts documented agents.list[].params overrides", () => {
365+
const res = validateConfigObject({
366+
agents: {
367+
list: [
368+
{
369+
id: "main",
370+
model: "anthropic/claude-opus-4-6",
371+
params: {
372+
cacheRetention: "none",
373+
temperature: 0.4,
374+
maxTokens: 8192,
375+
},
376+
},
377+
],
378+
},
379+
});
380+
381+
expect(res.ok).toBe(true);
382+
if (res.ok) {
383+
expect(res.config.agents?.list?.[0]?.params).toEqual({
384+
cacheRetention: "none",
385+
temperature: 0.4,
386+
maxTokens: 8192,
387+
});
388+
}
389+
});
390+
364391
it("flags legacy config entries without auto-migrating", async () => {
365392
await withTempHome(async (home) => {
366393
await writeOpenClawConfig(home, {

src/config/zod-schema.agent-runtime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,7 @@ export const AgentEntrySchema = z
757757
.strict()
758758
.optional(),
759759
sandbox: AgentSandboxSchema,
760+
params: z.record(z.string(), z.unknown()).optional(),
760761
tools: AgentToolsSchema,
761762
runtime: AgentRuntimeSchema,
762763
})

0 commit comments

Comments
 (0)