#22998: fix(config): add modelByChannel to allowed channels keys
size: XS
Cluster:
Wizard Enhancements and Config Fixes
Fixes #22963
## Summary
- `channels.modelByChannel` was added to the Zod schema and TypeScript types in 2026.2.21 but was not added to the runtime validation whitelist in `src/config/validation.ts`
- Configs using `channels.modelByChannel` are rejected with `unknown channel id: modelByChannel`, even though the feature works at runtime
- Adds `"modelByChannel"` to the `allowedChannels` set alongside `"defaults"`
## Test plan
- [ ] Set `channels.modelByChannel` in config and verify `openclaw doctor` no longer reports invalid config
- [ ] Verify per-channel model overrides still function correctly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds `modelByChannel` to the runtime validation allowlist in `src/config/validation.ts:240`. The `channels.modelByChannel` feature was added to the Zod schema and TypeScript types in commit f555835b (2026-02-20) but the runtime validation whitelist was not updated, causing configs with this valid key to be rejected with "unknown channel id: modelByChannel" errors.
- Aligns runtime validation with the schema definition in `src/config/zod-schema.providers.ts:34`
- Matches the existing pattern where `defaults` is also a special channel key
- Consistent with usage in `src/commands/doctor-state-integrity.ts:178` which already treats `modelByChannel` as a special case
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk
- Single-line fix that adds a missing validation whitelist entry for an already-implemented feature. The change is necessary, correct, and matches the existing pattern for special channel keys like `defaults`. No logical issues, security concerns, or edge cases identified.
- No files require special attention
<sub>Last reviewed commit: 945131e</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#23155: fix: add modelByChannel to allowed channel config keys
by tiagocampo · 2026-02-22
91.7%
#23211: fix: include modelByChannel in allowed channels validator
by westerbamos · 2026-02-22
91.1%
#22870: fix(config): allow modelByChannel in channels validation allowlist
by darcuri · 2026-02-21
90.2%
#20878: fix: Widen models.input to accept "video" and "audio" modalities
by marcodelpin · 2026-02-19
74.0%
#19020: bugfix(gateway): Handle invalid model provider API config gracefully\…
by funkyjonx · 2026-02-17
73.3%
#21298: fix(config): extend model input schema for video/audio modalities
by Alfa-ai-ccvs-tech · 2026-02-19
73.0%
#16290: fix: add field-level validation for custom LLM provider config
by superlowburn · 2026-02-14
72.7%
#20738: Fix model input schema to accept audio and video modalities
by Clawborn · 2026-02-19
72.7%
#20867: fix: allow 'video' and 'audio' in models.input config
by pierreeurope · 2026-02-19
72.5%
#10943: fix(config): resolve Control UI "Unsupported schema node" for confi...
by kraftbj · 2026-02-07
71.8%