mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 09:47:28 +00:00
fix(config): add missing params field to agents.list[] validation schema (#41171)
Merged via squash.
Prepared head SHA: 9522761cf1
Co-authored-by: atian8179 <255488364+atian8179@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
@@ -361,6 +361,33 @@ describe("config strict validation", () => {
|
||||
expect(res.ok).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts documented agents.list[].params overrides", () => {
|
||||
const res = validateConfigObject({
|
||||
agents: {
|
||||
list: [
|
||||
{
|
||||
id: "main",
|
||||
model: "anthropic/claude-opus-4-6",
|
||||
params: {
|
||||
cacheRetention: "none",
|
||||
temperature: 0.4,
|
||||
maxTokens: 8192,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
expect(res.ok).toBe(true);
|
||||
if (res.ok) {
|
||||
expect(res.config.agents?.list?.[0]?.params).toEqual({
|
||||
cacheRetention: "none",
|
||||
temperature: 0.4,
|
||||
maxTokens: 8192,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it("flags legacy config entries without auto-migrating", async () => {
|
||||
await withTempHome(async (home) => {
|
||||
await writeOpenClawConfig(home, {
|
||||
|
||||
@@ -757,6 +757,7 @@ export const AgentEntrySchema = z
|
||||
.strict()
|
||||
.optional(),
|
||||
sandbox: AgentSandboxSchema,
|
||||
params: z.record(z.string(), z.unknown()).optional(),
|
||||
tools: AgentToolsSchema,
|
||||
runtime: AgentRuntimeSchema,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user