-
-
Notifications
You must be signed in to change notification settings - Fork 52.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
Switching models via the TUI /model command (dropdown or typed) fails with model not allowed even when agents.defaults.models allowlist is correctly configured. The TUI dropdown also sends stale model IDs (e.g. claude-sonnet-4-5 instead of claude-sonnet-4-6).
Steps to reproduce
Steps to reproduce:
- Configure agents.defaults.models with anthropic/claude-sonnet-4-6 and an alias
- Run openclaw models status — confirms model is in allowlist
- Open TUI, type /model, select Sonnet from dropdown
- Gateway returns: model not allowed: anthropic/claude-sonnet-4-5
- Manually typing /model anthropic/claude-sonnet-4-6 also returns model not allowed
Expected behavior
Model switches successfully
Actual behavior
INVALID_REQUEST errorMessage=model not allowed
OpenClaw version
2026.2.17
Operating system
macOS 25.3.0 (arm64)
Install method
npm global
Logs, screenshots, and evidence
So even the exact string anthropic/claude-sonnet-4-6 typed manually is rejected. The allowlist is in the config but the gateway isn't honoring it. This is definitely a bug in 2026.2.17.
Let me try one more thing — maybe the config key needs to be at a different path:
Config is correct. The openclaw models status CLI reads it fine. But the running gateway rejects it. I think the session-level model override check uses a different code path that doesn't read from agents.defaults.models.
This is a bug worth reporting. For now, practical workaround — I can switch the primary model for you via config patch when you want to use Sonnet:
- Tell me "switch to sonnet" → I patch the primary model + restart
- Tell me "switch to opus" → I patch it backImpact and severity
No response
Additional information
Additional context:
- openclaw models status correctly shows all 3 models in allowlist
- The allowlist appears to be ignored at runtime for session-level overrides
- In 2026.2.15 the gateway also crashed on failed switch (fixed in 2026.2.17)
- Workaround: patching agents.defaults.model.primary via config works
Relevant log:
[ws] ⇄ res ✗ sessions.patch errorCode=INVALID_REQUEST errorMessage=model not allowed: anthropic/claude-sonnet-4-6
[ws] ⇄ res ✗ sessions.patch errorCode=INVALID_REQUEST errorMessage=model not allowed: anthropic/claude-sonnet-4-5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working