#23211: fix: include modelByChannel in allowed channels validator
size: XS
Cluster:
Wizard Enhancements and Config Fixes
## Summary
- The post-Zod config validator rejects `channels.modelByChannel` with `unknown channel id: modelByChannel` because the `allowedChannels` set only includes `"defaults"` and provider channel IDs (telegram, discord, etc.)
- The Zod schema correctly defines `modelByChannel` as a valid key under `channels`, so this is a mismatch between the two validation layers
- Adds `"modelByChannel"` to the `allowedChannels` set in `src/config/validation.ts`
- Adds a regression test in `config.schema-regressions.test.ts`
Fixes #23084, #23038, #23146, #23203
## Test plan
- [x] Added regression test: config with `channels.modelByChannel` validates successfully
- [ ] Existing tests pass (`pnpm test`)
- [ ] Manual: `openclaw doctor` no longer reports `unknown channel id: modelByChannel`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixed validation mismatch where `channels.modelByChannel` was correctly defined in the Zod schema but rejected by the post-Zod validator with "unknown channel id: modelByChannel" error. Added `"modelByChannel"` to the `allowedChannels` set alongside `"defaults"` and provider channel IDs, and included a regression test to prevent this issue from recurring.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The fix is a simple one-line change that adds a missing entry to an allowlist, directly addressing a bug where valid configuration was being incorrectly rejected. The change is accompanied by a comprehensive regression test that verifies the fix works correctly. The logic is straightforward and consistent with how `"defaults"` is already handled in the same set.
- No files require special attention
<sub>Last reviewed commit: ce71614</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
92.3%
#22998: fix(config): add modelByChannel to allowed channels keys
by bbekdemir · 2026-02-21
91.1%
#22870: fix(config): allow modelByChannel in channels validation allowlist
by darcuri · 2026-02-21
89.2%
#10943: fix(config): resolve Control UI "Unsupported schema node" for confi...
by kraftbj · 2026-02-07
76.6%
#16290: fix: add field-level validation for custom LLM provider config
by superlowburn · 2026-02-14
76.0%
#20878: fix: Widen models.input to accept "video" and "audio" modalities
by marcodelpin · 2026-02-19
76.0%
#10807: fix(config): coerce numeric meta.lastTouchedAt to ISO string
by mcaxtr · 2026-02-07
75.5%
#19020: bugfix(gateway): Handle invalid model provider API config gracefully\…
by funkyjonx · 2026-02-17
75.3%
#17579: fix(slack): prevent Zod default groupPolicy from breaking multi-acc...
by ZetiMente · 2026-02-15
75.1%
#20867: fix: allow 'video' and 'audio' in models.input config
by pierreeurope · 2026-02-19
74.3%