openclaw - 💡(How to fix) Fix Feature: per-channel / per-group / per-DM model override in config [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#53638Fetched 2026-04-08 01:25:34
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Allow configuring a model field at the channel, group, and DM level in openclaw.json, so different conversations can use different models without manual runtime overrides.

Root Cause

Allow configuring a model field at the channel, group, and DM level in openclaw.json, so different conversations can use different models without manual runtime overrides.

RAW_BUFFERClick to expand / collapse

Summary

Allow configuring a model field at the channel, group, and DM level in openclaw.json, so different conversations can use different models without manual runtime overrides.

Current behavior

Model selection granularity is limited to:

  • Global default (agents.defaults.model.primary) — applies to all new sessions
  • Per-session runtime override (/model or session_status(model=...)) — ephemeral, does not persist across session resets
  • Per-cron — each cron job declares its own model

There is no way to pin a model to a specific channel, group, or DM in config.

Desired behavior

Add an optional model field to the per-target config schemas:

WhatsApp

  • channels.whatsapp.groups.<group-id>.model — per-group override
  • channels.whatsapp.dms.<phone>.model — per-DM override
  • (optional) channels.whatsapp.model — channel-wide default for all WhatsApp sessions

Slack

  • channels.slack.channels.<channel-id>.model — per-channel override
  • (optional) channels.slack.model — channel-wide default for all Slack sessions

Resolution order (proposed)

  1. Per-target override (group/DM/channel-specific)
  2. Channel-wide default (channels.<provider>.model)
  3. Global default (agents.defaults.model.primary)

Use cases

  1. Cost control: Use a cheaper model (Haiku/Sonnet) for high-traffic group chats while keeping Opus for owner DMs
  2. Quality tiering: Pin critical business channels to the strongest model, casual groups to a lighter one
  3. Testing: Try a new model on a single channel before rolling it out globally
  4. Team separation: Different teams get different models based on their channel

Context

Currently running 35+ sessions across WhatsApp DMs, WhatsApp groups, Slack channels, and Slack threads. All inherit the global default unless manually overridden at runtime. The override does not survive session resets, making it impractical for persistent per-context model selection.

Environment

  • OpenClaw 2026.3.13
  • Channels: WhatsApp + Slack
  • Config schemas inspected: channels.whatsapp.groups.*, channels.whatsapp.dms.*, channels.slack.channels.* — none have a model field today

extent analysis

Fix Plan

To add an optional model field to the per-target config schemas, follow these steps:

  • Update the config schema to include the model field for each channel, group, and DM.
  • Modify the model selection logic to follow the proposed resolution order:
    1. Per-target override (group/DM/channel-specific)
    2. Channel-wide default (channels.<provider>.model)
    3. Global default (agents.defaults.model.primary)

Example code snippets:

# Update config schema
config_schema = {
    'channels': {
        'whatsapp': {
            'groups': {
                '<group-id>': {
                    'model': {'type': 'string', 'optional': True}
                }
            },
            'dms': {
                '<phone>': {
                    'model': {'type': 'string', 'optional': True}
                }
            },
            'model': {'type': 'string', 'optional': True}  # channel-wide default
        },
        'slack': {
            'channels': {
                '<channel-id>': {
                    'model': {'type': 'string', 'optional': True}
                }
            },
            'model': {'type': 'string', 'optional': True}  # channel-wide default
        }
    }
}

# Modify model selection logic
def get_model(target):
    # Check per-target override
    if 'model' in target:
        return target['model']
    # Check channel-wide default
    elif 'model' in target['channel']:
        return target['channel']['model']
    # Fallback to global default
    else:
        return agents.defaults.model.primary

Verification

To verify that the fix worked, test the following scenarios:

  • Create a new session with a per-target override and verify that the correct model is used.
  • Create a new session with a channel-wide default and verify that the correct model is used.
  • Create a new session without any overrides and verify that the global default model is used.

Extra Tips

  • Make sure to update the documentation to reflect the new config schema and model selection logic.
  • Consider adding validation to ensure that the model field only accepts valid model names.
  • Test the fix thoroughly to ensure that it works as expected in all scenarios.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Feature: per-channel / per-group / per-DM model override in config [1 participants]