Skip to content

[Bug]: channels.modelByChannel rejected by config validator as unknown channel id #23084

@teke0824-gif

Description

@teke0824-gif

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

  1. Install openclaw@2026.2.21-2
  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: modelByChannel

Root 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.js
  • daemon-cli.js
  • config-B9RhcgPL.js
  • config-irA2OYte.js
  • config-CVI5HMNP.js
  • plugin-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.

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