Skip to content

Control UI prepends wrong provider prefix when switching models #48256

@shadowto

Description

@shadowto

Description

When switching models in the Control UI (Sessions tab or Chat tab model selector), the UI incorrectly prepends the current session's provider prefix to the selected model ID, regardless of which provider the model actually belongs to.

Example

When a session is running on openrouter/hunter-alpha and the user tries to switch to qwen3-14b.gguf (a llama.cpp model), the UI sends:

sessions.patch → model: "openrouter/qwen3-14b.gguf"

instead of the correct:

sessions.patch → model: "llamacpp/qwen3-14b.gguf"

This causes the gateway to reject the request with:

GatewayRequestError: model not allowed: openrouter/qwen3-14b.gguf

Affected Scenarios

  • Switching from an OpenRouter session to an ollama model → incorrectly sends openrouter/ollama/<model>
  • Switching from an OpenRouter session to a llama.cpp model → incorrectly sends openrouter/llamacpp/<model>
  • Free models with provider-specific prefixes (nvidia/, qwen/, stepfun/) → incorrectly prepended with openrouter/

Root Cause

The Control UI constructs the model ID by prepending the current session's provider prefix to the model's local ID. It should instead use the full model ID as returned by models.list, which already includes the correct provider prefix (e.g., llamacpp/qwen3-14b.gguf, ollama/qwen3:14b).

Expected Behavior

The UI should send the model ID exactly as it appears in the models.list response, without modifying the provider prefix. The gateway's model whitelist uses the format <provider>/<model-id> and expects the correct provider prefix.

Workaround

Users can switch models via the session_status tool or /model command in the TUI, which correctly preserves the model ID.

Environment

  • OpenClaw version: 2026.3.13
  • Affected UI: openclaw-control-ui
  • Providers configured: openrouter, ollama, llamacpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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