openclaw - ✅(Solved) Fix [control-ui] Model dropdown shows duplicates and strips provider prefix on selection [1 pull requests, 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#53758Fetched 2026-04-08 01:23:49
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Participants
Timeline (top)
referenced ×6cross-referenced ×1

Fix Action

Workaround

Remove agents.defaults.models entirely so there is no allowlist — this eliminates duplicates. However, the provider prefix stripping issue still affects allowlist-based configurations.

PR fix notes

PR #59269: [control-ui] Fix model dropdown duplicates and provider prefix stripping (#53758)

Description (problem / solution / changelog)

Fixes #53758

Two fixes:

1. Model dropdown deduplication — The model dropdown was showing duplicate entries when the same model appeared from multiple config sources. Deduplication logic in agents-utils.ts now correctly merges entries by <provider>/<model> key, preferring catalog info while keeping user config.

2. Provider prefix stripping — When the server stores model references split into separate model and provider fields, models with multi-segment IDs (e.g. xiaomi/mimo-v2-pro from OpenRouter) were losing their provider prefix on recombination. The fix ensures resolvePreferredServerChatModel() always combines the server-supplied provider with the raw model ID instead of short-circuiting on the 'qualified' path. Also fixes two direct display sites in slash-command-executor.ts and usage-render-details.ts.


🤖 AI-assisted fix (Shweta)

Changed files

  • ui/src/ui/chat-model-ref.test.ts (modified, +34/-0)
  • ui/src/ui/chat-model-ref.ts (modified, +32/-0)
  • ui/src/ui/chat/slash-command-executor.ts (modified, +11/-2)
  • ui/src/ui/views/agents-utils.test.ts (modified, +286/-0)
  • ui/src/ui/views/agents-utils.ts (modified, +52/-15)
  • ui/src/ui/views/usage-render-details.ts (modified, +5/-1)
RAW_BUFFERClick to expand / collapse

Bug Description

The control-UI model dropdown exhibits two related issues:

1. Duplicate entries

When a model appears in both agents.defaults.models (allowlist) and agents.defaults.model.primary or agents.defaults.model.fallbacks, the dropdown shows duplicate entries for that model.

2. Provider prefix stripped on selection

When selecting a model from the dropdown, the UI strips the provider prefix. For example, selecting openrouter/xiaomi/mimo-v2-pro sends xiaomi/mimo-v2-pro to the gateway, which causes an allowlist mismatch (the allowlist expects the full prefixed form).

Steps to Reproduce

  1. Configure a model in both agents.defaults.models and agents.defaults.model.primary
  2. Open the control-UI model dropdown
  3. Observe duplicate entries for the model
  4. Select the model
  5. Observe the gateway rejects it due to allowlist mismatch (provider prefix stripped)

Workaround

Remove agents.defaults.models entirely so there is no allowlist — this eliminates duplicates. However, the provider prefix stripping issue still affects allowlist-based configurations.

Expected Behavior

  • Each model should appear once in the dropdown
  • Selecting a model should preserve the full provider-prefixed name (e.g., openrouter/xiaomi/mimo-v2-pro)

extent analysis

Fix Plan

To resolve the issues, we need to:

  • Remove duplicate entries from the dropdown
  • Preserve the provider prefix when selecting a model

Here are the concrete steps:

  • Update the dropdown population logic to use a Set to eliminate duplicates
  • Modify the selection handler to preserve the full provider-prefixed model name

Example code:

// Populate dropdown with unique models
const uniqueModels = new Set([...agents.defaults.models, ...agents.defaults.model.primary, ...agents.defaults.model.fallbacks]);
dropdownOptions = Array.from(uniqueModels).map(model => ({ label: model, value: model }));

// Preserve provider prefix on selection
const handleModelSelect = (selectedModel) => {
  const fullModelName = selectedModel; // Ensure the full provider-prefixed name is used
  // Send the fullModelName to the gateway
  gateway.send({ model: fullModelName });
};

Verification

To verify the fix:

  • Configure a model in both agents.defaults.models and agents.defaults.model.primary
  • Open the control-UI model dropdown and check for duplicate entries
  • Select a model and check the gateway request to ensure the provider prefix is preserved

Extra Tips

  • Consider adding input validation to ensure that models are correctly formatted with provider prefixes
  • Review the allowlist configuration to ensure it is correctly set up to expect the full provider-prefixed model names.

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 [control-ui] Model dropdown shows duplicates and strips provider prefix on selection [1 pull requests, 1 participants]