openclaw - ✅(Solved) Fix [Bug] Model selector UI incorrectly combines provider name with model ID [1 pull requests, 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#51510Fetched 2026-04-08 01:10:13
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
commented ×2cross-referenced ×1

Error Message

When trying to switch models in the OpenClaw Control UI, an error appears: "Invalid model: xxx is not a valid model". 4. Error appears immediately

Fix Action

Fixed

PR fix notes

PR #51737: fix(ui): keep provider-qualified model picker refs intact

Description (problem / solution / changelog)

## Summary

  • reuse the configured model collector in the agents overview picker so provider-qualified primary, fallback, and allowlisted model refs stay selectable
  • add a regression test that keeps the chat header picker sending the full provider-qualified model when switching across providers
  • add coverage for the overview picker so it shows configured provider-qualified values instead of falling back to a synthetic Current (...) entry

Testing

  • corepack pnpm --dir ui exec vitest run src/ui/views/chat.test.ts src/ui/views/agents.test.ts src/ui/views/agents-utils.test.ts --config vitest.config.ts
  • corepack pnpm --dir ui exec vitest run src/ui/chat-model-ref.test.ts src/ui/chat/slash-command-executor.node.test.ts --config vitest.config.ts

Closes #51608 Closes #51510

Changed files

  • ui/src/ui/views/agents-utils.ts (modified, +35/-13)
  • ui/src/ui/views/agents.test.ts (modified, +55/-0)
  • ui/src/ui/views/chat.test.ts (modified, +58/-3)
RAW_BUFFERClick to expand / collapse

Bug Description

When trying to switch models in the OpenClaw Control UI, an error appears: "Invalid model: xxx is not a valid model".

The UI appears to be incorrectly combining provider names with model IDs. For example:

  • Expected model: custom-coding-dashscope-aliyuncs-com/qwen3-max-2026-01-23
  • UI tries to save as: minimax-portal/qwen3-max-2026-01-23 (wrong provider)

Steps to Reproduce

  1. Open OpenClaw Control UI
  2. Navigate to model settings
  3. Try to change the model selection
  4. Error appears immediately

Expected Behavior

The model selector should correctly save the full model ID with the correct provider prefix.

Environment

  • OpenClaw version: 2026.3.13
  • UI: openclaw-control-ui
  • Channel: webchat

Additional Context

The underlying config seems to be correct when checked via config.get, but the UI appears to have a bug in how it parses/validates model names before saving.

extent analysis

Fix Plan

The fix involves updating the model selector in the OpenClaw Control UI to correctly parse and save the full model ID with the correct provider prefix.

Steps to Fix

  • Update the modelSelector.js file to correctly handle provider names and model IDs.
  • Modify the saveModel function to use the config.get method to retrieve the correct provider prefix.
  • Add input validation to ensure that the model ID is correctly formatted.

Example Code

// modelSelector.js
import config from '../config';

const saveModel = (modelId) => {
  const providerPrefix = config.get('providerPrefix');
  const fullModelId = `${providerPrefix}/${modelId}`;
  // Save the full model ID to the database or storage
  saveModelToDatabase(fullModelId);
};

const getModelId = (model) => {
  const providerPrefix = config.get('providerPrefix');
  const modelId = model.replace(`${providerPrefix}/`, '');
  return modelId;
};

// Update the model selector to use the correct provider prefix
const modelSelector = (model) => {
  const modelId = getModelId(model);
  const providerPrefix = config.get('providerPrefix');
  const fullModelId = `${providerPrefix}/${modelId}`;
  return fullModelId;
};

Verification

To verify that the fix worked, follow these steps:

  • Open the OpenClaw Control UI and navigate to the model settings.
  • Try to change the model selection.
  • Check that the error no longer appears and that the correct model ID is saved.

Extra Tips

  • Make sure to update the config.get method to return the correct provider prefix.
  • Add additional logging and error handling to ensure that any issues are properly reported and handled.

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 - ✅(Solved) Fix [Bug] Model selector UI incorrectly combines provider name with model ID [1 pull requests, 2 comments, 2 participants]