openclaw - 💡(How to fix) Fix [Bug] Webchat model selector prefixes all models with "anthropic/" regardless of actual provider [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#51506Fetched 2026-04-08 01:10:17
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

The webchat control UI model selector incorrectly prefixes all model IDs with anthropic/, ignoring the actual provider name. This causes "model not allowed" errors when switching to non-Anthropic models.

Error Message

Failed to set model: GatewayRequestError: model not allowed: anthropic/MiniMax-M2.5

Root Cause

The webchat control UI model selector incorrectly prefixes all model IDs with anthropic/, ignoring the actual provider name. This causes "model not allowed" errors when switching to non-Anthropic models.

Fix Action

Workaround

Use the /model command in chat to switch models manually:

/model zhipu/glm-5

Code Example

Failed to set model: GatewayRequestError: model not allowed: anthropic/MiniMax-M2.5

---

/model zhipu/glm-5
RAW_BUFFERClick to expand / collapse

Description

The webchat control UI model selector incorrectly prefixes all model IDs with anthropic/, ignoring the actual provider name. This causes "model not allowed" errors when switching to non-Anthropic models.

Steps to Reproduce

  1. Configure multiple providers in openclaw.json (e.g., anthropic, zhipu, minimax)
  2. Open the webchat control UI
  3. Use the model dropdown to switch to a non-Anthropic model (e.g., MiniMax-M2.5)

Expected Behavior

The model selector should send the correct provider-prefixed model ID:

  • minimax/MiniMax-M2.5
  • zhipu/glm-5

Actual Behavior

The model selector sends anthropic/MiniMax-M2.5, anthropic/glm-5, etc., resulting in:

Failed to set model: GatewayRequestError: model not allowed: anthropic/MiniMax-M2.5

Workaround

Use the /model command in chat to switch models manually:

/model zhipu/glm-5

Environment

  • OpenClaw version: 2026.3.13 (61d171a)
  • OS: macOS (arm64)
  • Providers configured: anthropic, zhipu (openai-completions), minimax (anthropic-messages)

extent analysis

Fix Plan

The fix involves updating the model selector logic to correctly prefix model IDs with the actual provider name.

Code Changes

To fix the issue, update the getModelId function in the webchat control UI model selector to use the correct provider name:

// Before
const getModelId = (model) => `anthropic/${model.id}`;

// After
const getModelId = (model) => `${model.provider}/${model.id}`;

Additionally, ensure that the model.provider property is correctly set for each model in the openclaw.json configuration file:

{
  "providers": [
    {
      "name": "anthropic",
      "models": [
        { "id": "model-1", "provider": "anthropic" }
      ]
    },
    {
      "name": "zhipu",
      "models": [
        { "id": "glm-5", "provider": "zhipu" }
      ]
    },
    {
      "name": "minimax",
      "models": [
        { "id": "MiniMax-M2.5", "provider": "minimax" }
      ]
    }
  ]
}

Verification

After applying the fix, verify that the model selector correctly prefixes model IDs with the actual provider name by:

  • Switching to a non-Anthropic model using the model dropdown
  • Checking the network requests sent by the webchat control UI to ensure the correct provider-prefixed model ID is used
  • Verifying that the model switch is successful and the "model not allowed" error is resolved

Extra Tips

  • Ensure that the openclaw.json configuration file is correctly formatted and updated with the latest provider and model information.
  • Consider adding additional logging or debugging statements to the model selector logic to help identify any future issues.

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