← Back to PRs

#23211: fix: include modelByChannel in allowed channels validator

by westerbamos open 2026-02-22 03:43 View on GitHub →
size: XS
## 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