-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Bug Description
channels.modelByChannel was introduced in v2026.2.21 (release notes) and is present in the Zod schema (ChannelsSchema), but the runtime config validator rejects it with:
channels.modelByChannel: unknown channel id: modelByChannel
This prevents the gateway from starting with a valid modelByChannel configuration.
Steps to Reproduce
- Install
openclaw@2026.2.21-2 - Set modelByChannel config:
# via config set (fails):
openclaw config set channels.modelByChannel --json '{"my-channel": {"*": "anthropic/claude-sonnet-4-6"}}'
# Error: Config validation failed: channels.modelByChannel: unknown channel id: modelByChannel
# via direct JSON edit (also fails on gateway restart):
# Add to ~/.openclaw/openclaw.json:
# "channels": { "modelByChannel": { "my-channel": { "*": "anthropic/claude-sonnet-4-6" } } }
openclaw gateway restart
# Config invalid: channels.modelByChannel: unknown channel id: modelByChannelRoot Cause
The config validator at dist/config-*.js (line ~5195) uses:
const allowedChannels = new Set(["defaults", ...CHANNEL_IDS]);modelByChannel is defined in ChannelsSchema via ChannelModelByChannelSchema, but is missing from the allowedChannels set in the runtime validator. This set is duplicated across multiple dist files:
config-DJkRS0fq.jsdaemon-cli.jsconfig-B9RhcgPL.jsconfig-irA2OYte.jsconfig-CVI5HMNP.jsplugin-sdk/config-Bn_wS7mW.js
Suggested Fix
Add "modelByChannel" to the allowedChannels set:
const allowedChannels = new Set(["defaults", "modelByChannel", ...CHANNEL_IDS]);Workaround
Patch all dist/config-*.js and dist/daemon-cli.js files manually with the above fix.
Environment
- OpenClaw version: 2026.2.21-2
- OS: macOS 26.3 (arm64)
- Node: 25.6.0
- Install method: npm global
Notes
openclaw doctor recognizes the feature ("modelByChannel configured, enabled automatically"), confirming the schema accepts it. Only the runtime config validator loop is missing the key.