#10056: fix: allow extra fields in HookConfig schema
stale
Cluster:
Configuration Fixes and Enhancements
## Summary
Change `HookConfigSchema` from `.strict()` to `.passthrough()` to allow hook-specific config fields.
## Problem
Hooks like `soul-evil` read extra config fields (`chance`, `file`, `purge`), but the Zod schema rejects them:
```
Invalid config: hooks.internal.entries.soul-evil: Unrecognized key: "chance"
```
## Solution
One-line fix in `zod-schema.hooks.ts`:
```diff
- .strict();
+ .passthrough();
```
This aligns the schema with the TypeScript type which uses `[key: string]: unknown`.
Fixes #10053
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates `src/config/zod-schema.hooks.ts` so per-hook entries under `hooks.internal.entries` are validated with `.passthrough()` rather than `.strict()`. This allows hook-specific configuration keys to be present without failing Zod validation, which aligns runtime validation with the `HookConfig` TypeScript type that permits additional fields.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a one-line schema adjustment scoped to hook-entry configs; it resolves a concrete validation mismatch without affecting other strict schemas in this file. No behavioral changes occur unless users provide additional keys, which are now correctly permitted by the TypeScript type and consumed by hook implementations.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#16412: fix(config): align tools.web.fetch schema with firecrawl/readabilit...
by ciberponk · 2026-02-14
74.8%
#12499: fix(config): add missing customBindHost to gateway Zod schema
by sfo2001 · 2026-02-09
73.9%
#23534: fix(config): add firecrawl and readability fields to ToolsWebFetchS...
by slayoffer · 2026-02-22
73.6%
#10807: fix(config): coerce numeric meta.lastTouchedAt to ISO string
by mcaxtr · 2026-02-07
71.9%
#8431: Hooks: add session-graphiti memory feed
by JorgeAlan · 2026-02-04
70.3%
#20673: fix #20566: allow unknown fields in provider config
by neipor · 2026-02-19
69.9%
#10943: fix(config): resolve Control UI "Unsupported schema node" for confi...
by kraftbj · 2026-02-07
69.6%
#19429: Fix/custom bind host validation
by frudas24 · 2026-02-17
69.1%
#9914: fix(hooks): resolve bundled hook dist paths and packaging checks
by zimmra · 2026-02-05
69.0%
#21712: feat(config): add custom commands to CommandsSchema
by Jimmysnielsen · 2026-02-20
68.9%