openclaw - 💡(How to fix) Fix [Bug]: Control UI model selector prepends wrong provider prefix to all models [2 comments, 2 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#48907Fetched 2026-04-08 00:51:12
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
1
Author
Participants
Timeline (top)
labeled ×2commented ×1

Component: Control UI (web) — model selector dropdown

Error Message

  1. Observe the error — the provider prefix is always anthropic/

Root Cause

Component: Control UI (web) — model selector dropdown

Code Example

"agents.defaults.model": {
  "primary": "anthropic/claude-sonnet-4-6",
  "fallbacks": ["openai-codex/gpt-5.4", "ollama/qwen2.5:14b-instruct"]
},
"agents.defaults.models": {
  "openai-codex/gpt-5.4": { "alias": "OpenAI Web" },
  "anthropic/claude-opus-4-6": { "alias": "Claude Opus" },
  "anthropic/claude-sonnet-4-6": { "alias": "Claude Sonnet" },
  "ollama/qwen2.5:14b-instruct": { "alias": "Qwen Local" }
}

### Steps to reproduce

1. Configure models from multiple providers (anthropic, ollama, openai-codex) with aliases
2. Open Control UI
3. Use the model selector dropdown to switch to a non-Anthropic model
4. Observe the error — the provider prefix is always anthropic/

### Expected behavior

1. Selecting "Qwen Local" should send `ollama/qwen2.5:14b-instruct`
2. Selecting "OpenAI Web" should send `openai-codex/gpt-5.4`

### Actual behavior

1. Selecting "Qwen Local" sends `anthropic/qwen2.5:14b-instruct` → fails
2. Selecting "OpenAI Web" sends `anthropic/gpt-5.4` → fails

### OpenClaw version

2026.3.13

### Operating system

Ubuntu 24.04 (Linux 6.8.0-106-generic x64)

### Install method

Node: v22.22.1

### Model

Claude-opus-4-6

### Provider / routing chain

--

### Config file / key location

_No response_

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Component: Control UI (web) — model selector dropdown

Description

The model selector in the Control UI sends the wrong provider prefix when switching models. All models are sent with the anthropic/ prefix regardless of their actual provider.

It appears the dropdown uses the model ID (e.g. qwen2.5:14b-instruct) but always prepends the current/primary provider (anthropic/) instead of the provider defined in the config for that model.

Config (relevant part)

"agents.defaults.model": {
  "primary": "anthropic/claude-sonnet-4-6",
  "fallbacks": ["openai-codex/gpt-5.4", "ollama/qwen2.5:14b-instruct"]
},
"agents.defaults.models": {
  "openai-codex/gpt-5.4": { "alias": "OpenAI Web" },
  "anthropic/claude-opus-4-6": { "alias": "Claude Opus" },
  "anthropic/claude-sonnet-4-6": { "alias": "Claude Sonnet" },
  "ollama/qwen2.5:14b-instruct": { "alias": "Qwen Local" }
}

### Steps to reproduce

1. Configure models from multiple providers (anthropic, ollama, openai-codex) with aliases
2. Open Control UI
3. Use the model selector dropdown to switch to a non-Anthropic model
4. Observe the error — the provider prefix is always anthropic/

### Expected behavior

1. Selecting "Qwen Local" should send `ollama/qwen2.5:14b-instruct`
2. Selecting "OpenAI Web" should send `openai-codex/gpt-5.4`

### Actual behavior

1. Selecting "Qwen Local" sends `anthropic/qwen2.5:14b-instruct` → fails
2. Selecting "OpenAI Web" sends `anthropic/gpt-5.4` → fails

### OpenClaw version

2026.3.13

### Operating system

Ubuntu 24.04 (Linux 6.8.0-106-generic x64)

### Install method

Node: v22.22.1

### Model

Claude-opus-4-6

### Provider / routing chain

--

### Config file / key location

_No response_

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue, we need to modify the model selector dropdown to use the correct provider prefix for each model.

  • Update the modelSelector.js file to parse the model ID and extract the provider prefix from the agents.defaults.models config.
  • Use the extracted provider prefix when sending the model ID.

Example code:

// modelSelector.js
const getModelProvider = (modelId) => {
  const models = config.agents.defaults.models;
  for (const model in models) {
    if (models[model].alias === modelId) {
      return model.split('/')[0];
    }
  }
  return 'anthropic'; // default provider
};

const handleModelSelect = (modelId) => {
  const provider = getModelProvider(modelId);
  const fullModelId = `${provider}/${modelId.split('/').pop()}`;
  // send the fullModelId to the server
};
  • Update the config.js file to ensure that the agents.defaults.models config is correctly formatted and accessible.

Verification

To verify that the fix worked, follow these steps:

  • Open the Control UI and select a non-Anthropic model from the dropdown.
  • Check the network requests to ensure that the correct provider prefix is being sent.
  • Test multiple models from different providers to ensure that the fix is working correctly.

Extra Tips

  • Make sure to update the config.js file to ensure that the agents.defaults.models config is correctly formatted and accessible.
  • Consider adding error handling to the getModelProvider function to handle cases where the model ID is not found in the config.

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

  1. Selecting "Qwen Local" should send ollama/qwen2.5:14b-instruct
  2. Selecting "OpenAI Web" should send openai-codex/gpt-5.4

Still need to ship something?

×6

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

Back to top recommendations

TRENDING