openclaw - ✅(Solved) Fix [Bug]: buildQualifiedChatModelValue ignores provider when model already contains slash [2 pull requests, 1 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#62390Fetched 2026-04-08 03:05:01
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Timeline (top)
cross-referenced ×3referenced ×3labeled ×2commented ×1

ui/src/ui/chat-model-ref.ts

buildQualifiedChatModelValue function returns the model string directly when it contains a slash (/), ignoring the provided provider parameter.

Root Cause

ui/src/ui/chat-model-ref.ts

buildQualifiedChatModelValue function returns the model string directly when it contains a slash (/), ignoring the provided provider parameter.

Fix Action

Fixed

PR fix notes

PR #62427: fix: buildQualifiedChatModelValue ignores provider when model contains slash

Description (problem / solution / changelog)

问题描述

当 model ID 已经包含斜杠(如 deepseek-ai/deepseek-v3.2),且同时提供了 provider(如 nvidia)时,原代码会跳过 provider 前缀,导致返回 deepseek-ai/deepseek-v3.2 而非正确的 nvidia/deepseek-ai/deepseek-v3.2

修复内容

resolveServerChatModelValue 函数现在在 provider 不为空时始终添加前缀,无论 model 是否已包含斜杠。

Acceptance Criteria

  • resolveServerChatModelValue('deepseek-ai/deepseek-v3.2', 'nvidia') 返回 'nvidia/deepseek-ai/deepseek-v3.2'
  • resolveServerChatModelValue('ollama/qwen3:30b', null) 返回 'ollama/qwen3:30b'(向后兼容)
  • 所有 10 个 chat-model-ref 测试通过

测试方法

 RUN  v4.1.2 /Users/lukin/Projects/fix-62390

✓  ui  ui/src/ui/chat-model-ref.test.ts (10 tests) 3ms

 Test Files  1 passed (1)  Tests  10 passed (10)  Start at  18:11:42  Duration  450ms (transform 10ms, setup 12ms, import 4ms, tests 3ms, environment 350ms)

测试结果:10 passed ✓

Closes #62390

Changed files

  • ui/src/ui/chat-model-ref.test.ts (modified, +8/-3)
  • ui/src/ui/chat-model-ref.ts (modified, +7/-6)

PR #62483: fix: preserve explicit provider prefixes for slash-delimited chat models [AI-assisted]

Description (problem / solution / changelog)

Summary

This PR fixes #62390 by preserving the explicit provider when a chat model id already contains a slash-delimited vendor/model segment.

What changed

  • updates uildQualifiedChatModelValue so provider-owned slash model ids are still qualified with the selected provider
  • keeps already-qualified values stable when the stored server value already matches the provider
  • adds targeted regression tests for provider-qualified slash model ids

Why

Before this change, selecting a provider such as vidia with a model like deepseek-ai/deepseek-v3.2 could drop the provider prefix and produce the wrong qualified model id. After this change, the explicit provider remains part of the qualified value while already-qualified values continue to round-trip cleanly.

Testing

  • Ran corepack pnpm --dir ui test src/ui/chat-model-ref.test.ts src/ui/chat-model-ref.provider-prefix.test.ts
  • Verified the new slash-model regression cases

AI usage

This PR was AI-assisted. I reviewed the change manually, understand the implementation, and validated it locally.

Fixes #62390

Changed files

  • ui/src/ui/chat-model-ref.provider-prefix.test.ts (added, +33/-0)
  • ui/src/ui/chat-model-ref.ts (modified, +13/-6)

Code Example

buildQualifiedChatModelValue("deepseek-ai/deepseek-v3.2", "nvidia")
// Returns: "deepseek-ai/deepseek-v3.2"
// Expected: "nvidia/deepseek-ai/deepseek-v3.2"

### Steps to reproduce

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "nvidia/z-ai/glm4.7",
        "fallbacks": [
          "nvidia/deepseek-ai/deepseek-v3.2"
        ]
      },
      "models": {
        "nvidia/deepseek-ai/deepseek-v3.2": {},
        "nvidia/z-ai/glm4.7": {
          "alias": "glm4"
        }
      },
      "sandbox": {
        "mode": "off"
      },
      "workspace": "~/.openclaw/workspace"
    },
    "list": [
      {
        "id": "main"
      }
    ]
  },
  
  "models": {
    "mode": "merge",
    "providers": {
     
  
      "nvidia": {
        "api": "openai-completions",
        "apiKey": "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",
        "baseUrl": "https://integrate.api.nvidia.com/v1",
        "models": [
          {
            "id": "minimaxai/minimax-m2.5",
            "name": "MiniMax M2.5"
          },
          {
            "id": "z-ai/glm4.7",
            "name": "GLM 4.7"
          },
          {
            "id": "deepseek-ai/deepseek-v3.2",
            "name": "DeepSeek V3.2"
          },
          {
            "id": "stepfun-ai/step-3.5-flash",
            "name": "Step 3.5 Flash"
          }
        ]
      }
    }
  }
 
  }
}


### Expected behavior

When a provider is explicitly provided, it should be prefixed to the model string, even if the model already contains a slash

### Actual behavior

the model string directly when it contains a slash (`/`), ignoring the provided `provider` 

### OpenClaw version

2026.4.5

### Operating system

macos

### Install method

github

### Model

nvidia/deepseek-ai/deepseek-v3.2

### Provider / routing chain

nvidia/deepseek-ai/deepseek-v3.2

### Additional provider/model setup details

_No response_

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

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Description

ui/src/ui/chat-model-ref.ts

buildQualifiedChatModelValue function returns the model string directly when it contains a slash (/), ignoring the provided provider parameter.

Current Behavior

buildQualifiedChatModelValue("deepseek-ai/deepseek-v3.2", "nvidia")
// Returns: "deepseek-ai/deepseek-v3.2"
// Expected: "nvidia/deepseek-ai/deepseek-v3.2"

### Steps to reproduce

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "nvidia/z-ai/glm4.7",
        "fallbacks": [
          "nvidia/deepseek-ai/deepseek-v3.2"
        ]
      },
      "models": {
        "nvidia/deepseek-ai/deepseek-v3.2": {},
        "nvidia/z-ai/glm4.7": {
          "alias": "glm4"
        }
      },
      "sandbox": {
        "mode": "off"
      },
      "workspace": "~/.openclaw/workspace"
    },
    "list": [
      {
        "id": "main"
      }
    ]
  },
  
  "models": {
    "mode": "merge",
    "providers": {
     
  
      "nvidia": {
        "api": "openai-completions",
        "apiKey": "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",
        "baseUrl": "https://integrate.api.nvidia.com/v1",
        "models": [
          {
            "id": "minimaxai/minimax-m2.5",
            "name": "MiniMax M2.5"
          },
          {
            "id": "z-ai/glm4.7",
            "name": "GLM 4.7"
          },
          {
            "id": "deepseek-ai/deepseek-v3.2",
            "name": "DeepSeek V3.2"
          },
          {
            "id": "stepfun-ai/step-3.5-flash",
            "name": "Step 3.5 Flash"
          }
        ]
      }
    }
  }
 
  }
}


### Expected behavior

When a provider is explicitly provided, it should be prefixed to the model string, even if the model already contains a slash

### Actual behavior

the model string directly when it contains a slash (`/`), ignoring the provided `provider` 

### OpenClaw version

2026.4.5

### Operating system

macos

### Install method

github

### Model

nvidia/deepseek-ai/deepseek-v3.2

### Provider / routing chain

nvidia/deepseek-ai/deepseek-v3.2

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The buildQualifiedChatModelValue function should be updated to prefix the provider to the model string, even if the model contains a slash.

Guidance

  • Review the buildQualifiedChatModelValue function in ui/src/ui/chat-model-ref.ts to ensure it correctly handles model strings with slashes and prefixes the provider as expected.
  • Verify that the function is correctly called with the provider parameter and that this parameter is not being ignored when the model string contains a slash.
  • Consider adding a conditional statement to check if the model string already contains a slash and handle it accordingly to ensure the provider is always prefixed.
  • Test the function with different model strings and providers to ensure it behaves as expected.

Example

function buildQualifiedChatModelValue(model: string, provider: string) {
  if (model.includes('/')) {
    // Prefix the provider to the model string
    return `${provider}/${model}`;
  } else {
    // Handle model strings without slashes
    return `${provider}/${model}`;
  }
}

Notes

The provided code snippet is a minimal example and may need to be adapted to the actual implementation of the buildQualifiedChatModelValue function.

Recommendation

Apply a workaround by updating the buildQualifiedChatModelValue function to correctly prefix the provider to the model string, even if the model contains a slash. This will ensure that the function behaves as expected and returns the correct qualified chat model value.

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

When a provider is explicitly provided, it should be prefixed to the model string, even if the model already contains a slash

Still need to ship something?

×6

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

Back to top recommendations

TRENDING