#20673: fix #20566: allow unknown fields in provider config
size: XS
Cluster:
Wizard Enhancements and Config Fixes
## Summary
When configuring a custom provider like claude-max with a proxy, OpenClaw was showing "[object Object]" connection error due to provider config serialization issues.
## Changes
- `src/config/zod-schema.core.ts`: Changed `.strict()` to `.catchall(z.unknown())` in `ModelProviderSchema` to preserve unknown fields during config parsing.
## Testing
- [x] Code compiles and passes format check
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Changed `ModelProviderSchema` from `.strict()` to `.catchall(z.unknown())` to allow custom provider configurations (like claude-max with proxy) to preserve unknown fields during parsing. Previously, `.strict()` would reject any fields not explicitly defined in the schema, causing serialization issues that manifested as "[object Object]" connection errors.
The change is minimal and follows existing patterns in the codebase where other schemas use `.catchall()` for similar flexibility (`src/config/zod-schema.ts:126`, `src/config/zod-schema.agents.ts:52`).
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk
- The change is simple, well-targeted, and follows existing patterns in the codebase. The only minor concern is that the TypeScript type definition doesn't fully reflect the schema change (missing index signature), but this won't cause runtime issues - just potential type-checking mismatches if code tries to access unknown fields
- No files require special attention - the change is straightforward and localized
<sub>Last reviewed commit: 370166c</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19020: bugfix(gateway): Handle invalid model provider API config gracefully\…
by funkyjonx · 2026-02-17
77.0%
#16290: fix: add field-level validation for custom LLM provider config
by superlowburn · 2026-02-14
75.7%
#14934: fix: add mistral to MemorySearchSchema provider/fallback unions
by ThomsenDrake · 2026-02-12
74.0%
#6683: feat(config): add supportsStrictMode compat option for model defini...
by long-pham · 2026-02-01
73.6%
#23211: fix: include modelByChannel in allowed channels validator
by westerbamos · 2026-02-22
72.8%
#18988: feat(config): add support for config warnings and improve validation
by saurav470 · 2026-02-17
72.8%
#10807: fix(config): coerce numeric meta.lastTouchedAt to ISO string
by mcaxtr · 2026-02-07
72.2%
#16766: fix(model): apply provider baseUrl/headers override to registry-fou...
by dzianisv · 2026-02-15
72.2%
#10197: fix: add missing allowAgents to agent defaults subagents schema
by Yida-Dev · 2026-02-06
71.7%
#17469: Improve unknown-model errors for provider/model misconfiguration
by megahappyclaw · 2026-02-15
71.7%