Skip to content

[Bug]: Model dropdown strips provider prefix, causing "model not allowed" error for non-Anthropic models #50647

@ctbritt

Description

@ctbritt

Bug type

Regression (worked before, now fails)

Summary

Selecting a non-default provider model from the webchat UI model dropdown fails with (with a default provider of anthropic) GatewayRequestError: model not allowed: anthropic/<model-id>. The UI appears to strip the provider prefix from the model ID (e.g. openai-codex/gpt-5.4 becomes gpt-5.4) before sending it to the gateway. The gateway then incorrectly prepends the default provider (anthropic/), producing an invalid ID.

Config excerpt (sanitized):

"agents": {
  "defaults": {
    "model": { "primary": "anthropic/claude-sonnet-4-6" },
    "models": {
      "openai-codex/gpt-5.4": {},
      "openrouter/xiaomi/mimo-v2-omni": {}
    }
  }
}

Steps to reproduce

  1. Configure a non-Anthropic model in agents.defaults.models, e.g. openai-codex/gpt-5.4
  2. Open webchat UI
  3. Click the model dropdown
  4. Select the non-Anthropic model (shows correctly as gpt-5.4 · openai-codex)
  5. Error: Failed to set model: GatewayRequestError: model not allowed: anthropic/gpt-5.4

Expected behavior

Gateway receives openai-codex/gpt-5.4

Actual behavior

Gateway receives anthropic/gpt-5.4

OpenClaw version

2026.3.13

Operating system

macOS 26.4

Install method

npm global

Model

gpt-5.4

Provider / routing chain

openai-codex

Additional provider/model setup details

Default provider is anthropic in my case

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

Note: Anthropic models work fine because stripping anthropic/ and re-prepending it is a no-op. The bug only surfaces for models on other providers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions