Use Case
In a Discord server (or Telegram group), different channels often serve different purposes:
- #daily — low-cost summarization channel using a free/cheap model (e.g.
openrouter/healer-alpha)
- #dev — coding assistant channel using a capable model (e.g.
anthropic/claude-opus-4.6)
- #casual — general chat with a different persona/system prompt
Currently, the gateway uses a single global model + system prompt for all channels. Users who need per-channel differentiation must run separate bot instances or use an external routing layer.
Proposed Design
Add a channel_overrides section under each platform config in config.yaml:
platforms:
discord:
enabled: true
channel_overrides:
"1234567890": # channel ID
model: openrouter/healer-alpha
provider: openrouter
system_prompt: "You are a daily news summarizer."
"9876543210":
model: anthropic/claude-opus-4.6
provider: anthropic
system_prompt: "You are a coding assistant."
Resolution priority (high → low):
/model command (ephemeral, per-session)
channel_overrides[channel_id] (persistent, per-channel)
model.default / agent.system_prompt (global fallback)
Implementation scope:
gateway/config.py — extend PlatformConfig with channel_overrides: Dict[str, ChannelOverride]
gateway/run.py — _resolve_gateway_model() and _load_ephemeral_system_prompt() accept chat_id parameter, check overrides before global config
- Agent construction — pass resolved model/provider/system_prompt per dispatch
What it does NOT change:
- No changes to CLI mode
- No changes to the agent loop or prompt caching
- Channels without overrides behave exactly as today
Alternatives Considered
- Multiple bot instances: works but wastes resources, hard to manage
- External routing proxy: adds latency and complexity
- Personality system (
/personality): exists but is per-session, not per-channel, and does not support model overrides
Prior Art
Other agent frameworks (e.g. OpenClaw) support modelByChannel config and it is a commonly requested feature for multi-channel deployments.
Use Case
In a Discord server (or Telegram group), different channels often serve different purposes:
openrouter/healer-alpha)anthropic/claude-opus-4.6)Currently, the gateway uses a single global model + system prompt for all channels. Users who need per-channel differentiation must run separate bot instances or use an external routing layer.
Proposed Design
Add a
channel_overridessection under each platform config inconfig.yaml:Resolution priority (high → low):
/modelcommand (ephemeral, per-session)channel_overrides[channel_id](persistent, per-channel)model.default/agent.system_prompt(global fallback)Implementation scope:
gateway/config.py— extendPlatformConfigwithchannel_overrides: Dict[str, ChannelOverride]gateway/run.py—_resolve_gateway_model()and_load_ephemeral_system_prompt()acceptchat_idparameter, check overrides before global configWhat it does NOT change:
Alternatives Considered
/personality): exists but is per-session, not per-channel, and does not support model overridesPrior Art
Other agent frameworks (e.g. OpenClaw) support
modelByChannelconfig and it is a commonly requested feature for multi-channel deployments.