openclaw - 💡(How to fix) Fix Control UI: Default model label shows underlying provider (anthropic) instead of routing provider (openrouter) [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#59764Fetched 2026-04-08 02:40:49
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

The Control UI model dropdown's Default label displays the underlying model provider (e.g. anthropic) instead of the routing provider (openrouter) when using OpenRouter models.

Root Cause

The gateway stores session model data with the provider separated from the model ID:

  • model: "anthropic/claude-sonnet-4.6"
  • modelProvider: "openrouter"

The UI's formatChatModelDisplay() function in chat-model-ref.ts splits the model string on the first / and uses the left side as the provider label — so anthropic/claude-sonnet-4.6 renders as claude-sonnet-4.6 · anthropic, ignoring the modelProvider field entirely.

The dropdown list items correctly show · openrouter (because they use the full qualified ID from the catalog), but the Default line uses sessionsResult.defaults.model + sessionsResult.defaults.modelProvider via resolvePreferredServerChatModelValue(), which hits the same formatting issue.

RAW_BUFFERClick to expand / collapse

Summary

The Control UI model dropdown's Default label displays the underlying model provider (e.g. anthropic) instead of the routing provider (openrouter) when using OpenRouter models.

Steps to Reproduce

  1. Configure agents.defaults.model.primary to openrouter/anthropic/claude-sonnet-4.6
  2. Open the Control UI model dropdown
  3. Observe the Default label

Expected

Default (claude-sonnet-4.6 · openrouter)

Actual

Default (claude-sonnet-4.6 · anthropic)

Root Cause

The gateway stores session model data with the provider separated from the model ID:

  • model: "anthropic/claude-sonnet-4.6"
  • modelProvider: "openrouter"

The UI's formatChatModelDisplay() function in chat-model-ref.ts splits the model string on the first / and uses the left side as the provider label — so anthropic/claude-sonnet-4.6 renders as claude-sonnet-4.6 · anthropic, ignoring the modelProvider field entirely.

The dropdown list items correctly show · openrouter (because they use the full qualified ID from the catalog), but the Default line uses sessionsResult.defaults.model + sessionsResult.defaults.modelProvider via resolvePreferredServerChatModelValue(), which hits the same formatting issue.

Impact

Users routing through OpenRouter see · anthropic in the Default label, causing confusion about whether OpenRouter is actually active — even when it is working correctly.

Environment

  • OpenClaw 2026.4.2
  • macOS Darwin 25.3.0 (arm64)
  • Routing provider: OpenRouter
  • Model: openrouter/anthropic/claude-sonnet-4.6

extent analysis

TL;DR

Update the formatChatModelDisplay() function to use the modelProvider field instead of splitting the model string to determine the provider label.

Guidance

  • Review the formatChatModelDisplay() function in chat-model-ref.ts to understand how it currently determines the provider label.
  • Modify the function to use the modelProvider field when available, instead of relying on the model string split.
  • Verify that the change fixes the issue by checking the Default label in the Control UI model dropdown after updating the function.
  • Consider adding a check to ensure the modelProvider field is used consistently throughout the application to avoid similar issues.

Example

// Before
function formatChatModelDisplay(model: string) {
  const [provider, modelName] = model.split('/');
  return `${modelName} · ${provider}`;
}

// After
function formatChatModelDisplay(model: string, modelProvider?: string) {
  if (modelProvider) {
    return `${model.split('/').pop()} · ${modelProvider}`;
  }
  const [provider, modelName] = model.split('/');
  return `${modelName} · ${provider}`;
}

Notes

This solution assumes that the modelProvider field is always available when using OpenRouter models. If this is not the case, additional logic may be needed to handle situations where the field is missing.

Recommendation

Apply the workaround by updating the formatChatModelDisplay() function to use the modelProvider field, as this should fix the issue without requiring a version upgrade.

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