openclaw - ✅(Solved) Fix [Bug]: UI Model selection Normalisation & Deduplication [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#51439Fetched 2026-04-08 01:11:13
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×2commented ×1cross-referenced ×1referenced ×1

HI I have only two models but the chat selection shows 4.

Root Cause

HI I have only two models but the chat selection shows 4.

Fix Action

Fixed

PR fix notes

PR #51492: fix: deduplicate model catalog entries in UI selection (#51439)

Description (problem / solution / changelog)

Problem

Users configuring 2 models see 4 entries in the UI model selection dropdown (duplicates).

Root cause

buildAllowedModelSet in src/agents/model-selection.ts returned allowedCatalog with duplicate entries when the model catalog contained the same model multiple times from different discovery sources.

Fix

Added deduplicateCatalog() helper that filters by modelKey(provider, id), keeping only the first occurrence. Applied in all three return paths of buildAllowedModelSet:

  1. The allowAny path (no allowlist configured)
  2. The allowlist-filtered path
  3. The empty-allowlist fallback path

Tests

Added 2 regression tests:

  • Dedup with allowlist filtering
  • Dedup in allowAny mode

Both pass. Pre-existing test failure (ANSI escape codes) is unrelated.

Fixes #51439

Changed files

  • .github/workflows/claude.yml (added, +33/-0)
  • GEMINI.md (added, +1/-0)
  • src/agents/model-selection.test.ts (modified, +48/-0)
  • src/agents/model-selection.ts (modified, +33/-6)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

HI I have only two models but the chat selection shows 4.

Steps to reproduce

<img width="618" height="179" alt="Image" src="https://github.com/user-attachments/assets/249011ce-73d3-40f2-bd1c-9a8927454a1f" />

Expected behavior

2 models showed

Actual behavior

4 models showed

OpenClaw version

2026.2.17

Operating system

Mac OS 15.7.4

Install method

No response

Model

qwen2.5-coder:7b/openai/gpt-5-nano

Provider / routing chain

"models": { "mode": "merge", "providers": { "ollama": { "baseUrl": "http://127.0.0.1:11434", "apiKey": "ollama-local", "api": "ollama", "models": [ { "id": "qwen2.5-coder:7b", "name": "qwen2.5-coder:7b", "contextWindow": 131072 } ] }, "openrouter": { "baseUrl": "https://openrouter.ai", "api": "openai-responses", "models": [ { "id": "openai/gpt-5-nano", "name": "GPT-5 nano", "contextWindow": 200000 } ] } } },

Additional provider/model setup details

  "models": [
    {
      "id": "openai/gpt-5-nano",
      "name": "GPT-5 nano",
      "contextWindow": 200000,
      "reasoning": false,
      "input": [
        "text"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "maxTokens": 8192,
      "api": "openai-responses"
    },
    {
      "id": "auto",
      "name": "OpenRouter Auto",
      "reasoning": false,
      "input": [
        "text",
        "image"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 200000,
      "maxTokens": 8192
    },
    {
      "id": "openrouter/hunter-alpha",
      "name": "Hunter Alpha",
      "reasoning": true,
      "input": [
        "text"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 1048576,
      "maxTokens": 65536
    },
    {
      "id": "openrouter/healer-alpha",
      "name": "Healer Alpha",
      "reasoning": true,
      "input": [
        "text",
        "image"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 262144,
      "maxTokens": 65536
    }
  ],

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue of showing 4 models instead of 2, we need to update the models configuration to only include the desired models.

Step-by-Step Solution

  • Update the models configuration to only include the qwen2.5-coder:7b and openai/gpt-5-nano models.
  • Remove any unnecessary models from the configuration.

Example Code

"models": {
  "mode": "merge",
  "providers": {
    "ollama": {
      "baseUrl": "http://127.0.0.1:11434",
      "apiKey": "ollama-local",
      "api": "ollama",
      "models": [
        {
          "id": "qwen2.5-coder:7b",
          "name": "qwen2.5-coder:7b",
          "contextWindow": 131072
        }
      ]
    },
    "openrouter": {
      "baseUrl": "https://openrouter.ai",
      "api": "openai-responses",
      "models": [
        {
          "id": "openai/gpt-5-nano",
          "name": "GPT-5 nano",
          "contextWindow": 200000
        }
      ]
    }
  }
}

Verification

To verify that the fix worked, restart the application and check the model selection. It should now only show the 2 desired models.

Extra Tips

  • Make sure to update the models configuration correctly to avoid any typos or incorrect model IDs.
  • If you are still experiencing issues, try checking the application logs for any errors or warnings related to the model configuration.

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

2 models showed

Still need to ship something?

×6

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

Back to top recommendations

TRENDING