fix(config): add missing params field to AgentEntrySchema#26138
Open
moliendocode wants to merge 2 commits intoopenclaw:mainfrom
Open
fix(config): add missing params field to AgentEntrySchema#26138moliendocode wants to merge 2 commits intoopenclaw:mainfrom
moliendocode wants to merge 2 commits intoopenclaw:mainfrom
Conversation
|
This pull request has been automatically marked as stale due to inactivity. |
Author
|
Still active — the bug persists as of v2026.3.2 (see #27173 comment #27173 (comment)). The fix is minimal (XS), CI is green, and the branch is still mergeable. Would appreciate a review when possible. |
PR openclaw#17470 added per-agent `params` overrides to the TypeScript type (`AgentConfig`) and runtime logic (`extra-params.ts`) but missed adding the field to the Zod validation schema. Because `AgentEntrySchema` uses `.strict()`, any `params` key in the agent config is silently rejected at parse time, making the feature unusable. Add `params: z.record(z.string(), z.unknown()).optional()` to `AgentEntrySchema` to match the existing type definition. Closes openclaw#25903 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Regression test ensuring `AgentEntrySchema` accepts the `params` field and still rejects truly unknown fields via `.strict()`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
71167e1 to
246d93c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
paramstoAgentEntrySchemaZod validation — PR feat(cache): per-agent params for cacheRetention control (#17112) #17470 added per-agentparamsoverrides to the TypeScript type (AgentConfig) and runtime logic (extra-params.ts) but missed updating the Zod schema. BecauseAgentEntrySchemauses.strict(), anyparamskey in agent config is silently rejected at parse time, making the feature unusable.paramsin agent entries and still rejects truly unknown fields via.strict().Closes #25903
What changed
src/config/zod-schema.agent-runtime.ts— one line:This matches the existing TypeScript type definition at
types.agents.ts:33:Test plan
pnpm build— passespnpm check(format + types + lint) — 0 errorspnpm test— 10,485 passed (53 preexisting network timeout failures unrelated to this change)paramsin agent entriesAI-assisted PR 🤖
params) to the Zod validation schema for agent entries. The field accepts an arbitrary record of string keys to unknown values, matching the existing TypeScript type. The.strict()mode onAgentEntrySchemawas causing Zod to reject theparamskey since it wasn't declared in the schema, even though the runtime code already supported it.🤖 Generated with Claude Code
Greptile Summary
Adds the missing
paramsfield toAgentEntrySchemaZod validation. PR #17470 introduced per-agentparamsoverrides to the TypeScript type (AgentConfigatsrc/config/types.agents.ts:33) and runtime logic (extra-params.ts:34-36) but missed updating the Zod schema. SinceAgentEntrySchemauses.strict()mode, anyparamskey in agent config was silently rejected at parse time, making the feature unusable.The fix adds a single line to the Zod schema matching the existing TypeScript type:
The regression test validates that:
paramsin agent entries.strict()mode still rejects truly unknown fieldsConfidence Score: 5/5
Last reviewed commit: 71167e1
(2/5) Greptile learns from your feedback when you react with thumbs up/down!