Skip to content

channels.modelByChannel rejected by runtime validator: "unknown channel id: modelByChannel" #23351

@tonyno82

Description

@tonyno82

Bug description

channels.modelByChannel is defined in the Zod schema (ChannelsSchema) and documented in the Configuration Reference, but the runtime config validator rejects it with:

Invalid config at ~/.openclaw/openclaw.json:
- channels.modelByChannel: unknown channel id: modelByChannel

Root cause

The validator builds a whitelist of allowed channels keys:

const allowedChannels = new Set(["defaults", ...CHANNEL_IDS]);

CHANNEL_IDS = ["telegram", "whatsapp", "discord", "irc", "googlechat", "slack", "signal", "imessage"].

"modelByChannel" is missing from this set, so the validator rejects it — even though:

  1. The Zod schema includes it: modelByChannel: ChannelModelByChannelSchema
  2. The runtime resolver in reply-*.js reads from params.cfg.channels?.modelByChannel
  3. The docs describe the feature with examples
  4. openclaw doctor recognizes it: "modelByChannel configured, enabled automatically"

Suggested fix

Add "modelByChannel" to the allowed channels set:

const allowedChannels = new Set(["defaults", "modelByChannel", ...CHANNEL_IDS]);

Config used

{
  channels: {
    modelByChannel: {
      telegram: {
        "123456789": "anthropic/claude-opus-4-6",
      },
    },
  },
}

Environment

  • OpenClaw version: 2026.2.21-2 (35a57bc)
  • OS: Ubuntu 24.04.3 LTS (x64)
  • Node: v22.22.0

Changelog reference

Channels: allow per-channel model overrides via channels.modelByChannel and note them in /status. Thanks @thewilloftheshadow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions