openclaw - ✅(Solved) Fix [Bug]: session_status reports default model instead of channels.modelByChannel effective model [1 pull requests, 2 comments, 3 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#52189Fetched 2026-04-08 01:14:30
View on GitHub
Comments
2
Participants
3
Timeline
12
Reactions
0
Author
Timeline (top)
referenced ×5cross-referenced ×3commented ×2labeled ×2

When using channels.modelByChannel for IRC, the actual routed model is correct, but session_status reports the default agent model instead of the effective channel-selected model

Version

Observed on: OpenClaw 2026.3.13 Config "channels": { "irc": { "channels": ["#ops", "#alerts", "#dev"] }, "modelByChannel": { "irc": { "#ops": "anthropic/claude-sonnet-4-6", "#alerts": "openai/gpt-5-mini", "#dev": "openai-codex/gpt-5.4" } } } What happens

For IRC channel #dev:

• session store shows: • modelProvider: openai-codex • model: gpt-5.4 • transcript JSONL for recent #dev turns shows assistant runs with: • api: openai-codex-responses • provider: openai-codex • model: gpt-5.4

But when the assistant calls session_status, it reports:

• anthropic/claude-sonnet-4-6

So the actual routed model and the reported model diverge. Evidence

Session key:

• agent:main:irc:group:#dev

In the session transcript for #dev, assistant turns are recorded with:

• provider: openai-codex • model: gpt-5.4

But the nested session_status tool result in the same flow reports:

• Model: anthropic/claude-sonnet-4-6 Expected behavior

If a session is actively using a channels.modelByChannel override, session_status should report the actual effective model for that session. Likely cause

From local inspection of the dist bundle, buildStatusMessage(...) appears to derive the displayed selected model from:

• sessionEntry.providerOverride • sessionEntry.modelOverride • otherwise the agent default model

Relevant code path: const selectedProvider = entry?.providerOverride ?? resolved.provider ?? "anthropic"; const selectedModel = entry?.modelOverride ?? resolved.model ?? "claude-opus-4-6"; This seems to ignore the routed session model fields:

• sessionEntry.modelProvider • sessionEntry.model

So channel model overrides can execute correctly while status still reports the default agent model.

Root Cause

When using channels.modelByChannel for IRC, the actual routed model is correct, but session_status reports the default agent model instead of the effective channel-selected model

Version

Observed on: OpenClaw 2026.3.13 Config "channels": { "irc": { "channels": ["#ops", "#alerts", "#dev"] }, "modelByChannel": { "irc": { "#ops": "anthropic/claude-sonnet-4-6", "#alerts": "openai/gpt-5-mini", "#dev": "openai-codex/gpt-5.4" } } } What happens

For IRC channel #dev:

• session store shows: • modelProvider: openai-codex • model: gpt-5.4 • transcript JSONL for recent #dev turns shows assistant runs with: • api: openai-codex-responses • provider: openai-codex • model: gpt-5.4

But when the assistant calls session_status, it reports:

• anthropic/claude-sonnet-4-6

So the actual routed model and the reported model diverge. Evidence

Session key:

• agent:main:irc:group:#dev

In the session transcript for #dev, assistant turns are recorded with:

• provider: openai-codex • model: gpt-5.4

But the nested session_status tool result in the same flow reports:

• Model: anthropic/claude-sonnet-4-6 Expected behavior

If a session is actively using a channels.modelByChannel override, session_status should report the actual effective model for that session. Likely cause

From local inspection of the dist bundle, buildStatusMessage(...) appears to derive the displayed selected model from:

• sessionEntry.providerOverride • sessionEntry.modelOverride • otherwise the agent default model

Relevant code path: const selectedProvider = entry?.providerOverride ?? resolved.provider ?? "anthropic"; const selectedModel = entry?.modelOverride ?? resolved.model ?? "claude-opus-4-6"; This seems to ignore the routed session model fields:

• sessionEntry.modelProvider • sessionEntry.model

So channel model overrides can execute correctly while status still reports the default agent model.

Fix Action

Fixed

PR fix notes

PR #52247: fix: session_status reports effective channel model override instead of default

Description (problem / solution / changelog)

Summary

When channels.modelByChannel is configured for a channel (e.g. IRC #devopenai-codex/gpt-5.4), session_status now correctly reports the effective channel-overridden model instead of the default agent model.

Problem

buildStatusMessage resolved the selected model from:

  1. sessionEntry.providerOverride / modelOverride (per-session overrides)
  2. The agent default model

It completely ignored channels.modelByChannel overrides when computing the displayed model. The channel override was only used to append a "channel override" annotation note — but the 🧠 Model: line still showed the default agent model.

This meant that for an IRC channel configured with openai-codex/gpt-5.4, the actual model routing was correct (transcript/API calls used the right model), but session_status reported the default anthropic/claude-sonnet-4-6.

Fix

Moved the channel model override resolution to happen before the selected model is used to build model refs and the status card. When no per-session override exists, the channel model override is now applied to selectedProvider/selectedModel, so the status card reflects the actual effective model.

Also simplified the channelModelNote computation — replaced the redundant IIFE (which re-resolved the channel override) with a simple boolean flag since the override is already resolved earlier.

Changes

  • src/auto-reply/status.ts: Resolve channel model override early and apply to selectedProvider/selectedModel when no per-session override exists

Fixes #52189

Changed files

  • src/auto-reply/status.ts (modified, +34/-40)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When using channels.modelByChannel for IRC, the actual routed model is correct, but session_status reports the default agent model instead of the effective channel-selected model

Version

Observed on: OpenClaw 2026.3.13 Config "channels": { "irc": { "channels": ["#ops", "#alerts", "#dev"] }, "modelByChannel": { "irc": { "#ops": "anthropic/claude-sonnet-4-6", "#alerts": "openai/gpt-5-mini", "#dev": "openai-codex/gpt-5.4" } } } What happens

For IRC channel #dev:

• session store shows: • modelProvider: openai-codex • model: gpt-5.4 • transcript JSONL for recent #dev turns shows assistant runs with: • api: openai-codex-responses • provider: openai-codex • model: gpt-5.4

But when the assistant calls session_status, it reports:

• anthropic/claude-sonnet-4-6

So the actual routed model and the reported model diverge. Evidence

Session key:

• agent:main:irc:group:#dev

In the session transcript for #dev, assistant turns are recorded with:

• provider: openai-codex • model: gpt-5.4

But the nested session_status tool result in the same flow reports:

• Model: anthropic/claude-sonnet-4-6 Expected behavior

If a session is actively using a channels.modelByChannel override, session_status should report the actual effective model for that session. Likely cause

From local inspection of the dist bundle, buildStatusMessage(...) appears to derive the displayed selected model from:

• sessionEntry.providerOverride • sessionEntry.modelOverride • otherwise the agent default model

Relevant code path: const selectedProvider = entry?.providerOverride ?? resolved.provider ?? "anthropic"; const selectedModel = entry?.modelOverride ?? resolved.model ?? "claude-opus-4-6"; This seems to ignore the routed session model fields:

• sessionEntry.modelProvider • sessionEntry.model

So channel model overrides can execute correctly while status still reports the default agent model.

Steps to reproduce

  1. Configure channels.modelByChannel for IRC channels.
  2. Set one channel (e.g. #dev) to a non-default model such as openai-codex/gpt-5.4.
  3. Restart the gateway.
  4. Send a normal message in #dev.
  5. Trigger a path that calls session_status.
  6. Observe:

• actual run metadata shows the channel override model • session_status reports the default agent model instead.

Expected behavior

/status should return the actual active model.

Actual behavior

Incorrect model output occurs from /status

OpenClaw version

2026.3.13

Operating system

Ubuntu 24.04

Install method

No response

Model

sonet, opus, gpt-5.4

Provider / routing chain

openclaw -> codex-api, openclaw->anthropic api

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue, we need to update the buildStatusMessage function to use the sessionEntry.modelProvider and sessionEntry.model fields when a channel model override is in effect.

Step-by-Step Solution

  1. Update the buildStatusMessage function:
    • Check if sessionEntry.modelProvider and sessionEntry.model are set.
    • If they are set, use them to determine the selected model.
  2. Modify the code:

const selectedProvider = entry?.modelProvider ?? entry?.providerOverride ?? resolved.provider ?? "anthropic"; const selectedModel = entry?.model ?? entry?.modelOverride ?? resolved.model ?? "claude-opus-4-6";

3. **Verify the fix**:
   * Restart the gateway.
   * Send a normal message in the channel with the non-default model.
   * Trigger a path that calls `session_status`.
   * Check that the actual run metadata and `session_status` report the same model.

### Verification
To verify that the fix worked, check the following:
* The `session_status` output matches the actual model used for the session.
* The `sessionEntry.modelProvider` and `sessionEntry.model` fields are used to determine the selected model when a channel model override is in effect.

### Extra Tips
* Make sure to test the fix with different channel model overrides to ensure it works correctly in all cases.
* Consider adding logging or debugging statements to verify that the correct model is being used.

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…

FAQ

Expected behavior

/status should return the actual active model.

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 - ✅(Solved) Fix [Bug]: session_status reports default model instead of channels.modelByChannel effective model [1 pull requests, 2 comments, 3 participants]