Description
When switching models in the Control UI chat page, the model selector sends an incorrect provider prefix in the sessions.patch request. It uses the current default provider's prefix instead of the selected model's actual provider prefix.
Steps to Reproduce
- Configure multiple providers (e.g.,
zai, kimi-coding, openai-codex)
- Set
zai/glm-5 as the default model
- Open the Control UI at
http://127.0.0.1:18789/chat
- Try to switch to
k2p5 · kimi-coding from the model dropdown
Expected Behavior
The UI should send:
{"type":"sessions.patch","payload":{"session":"agent:main:main","model":"kimi-coding/k2p5"}}
Actual Behavior
The UI sends:
{"type":"sessions.patch","payload":{"session":"agent:main:main","model":"zai/k2p5"}}
This results in error:
Failed to set model: GatewayRequestError: model not allowed: zai/k2p5
Gateway Logs
[ws] ⇄ res ✗ sessions.patch 26ms errorCode=INVALID_REQUEST errorMessage=model not allowed: zai/k2p5
Same issue occurs when switching to other models:
- Selecting
gpt-5.4 · openai-codex sends zai/gpt-5.4 (wrong)
- Should send
openai-codex/gpt-5.4 (correct)
Workaround
Use CLI to switch models:
openclaw config set agents.defaults.model.primary "kimi-coding/k2p5"
pkill -f openclaw; openclaw start
Environment
Root Cause Analysis
The model selector dropdown appears to be using the currently active/default provider prefix instead of the selected model's actual provider when constructing the sessions.patch request payload.
Looking at the UI code, the model dropdown correctly displays models with their provider suffix (e.g., "k2p5 · kimi-coding"), but when the selection is made, the provider resolution logic seems to default to the current primary provider rather than parsing the selected model's provider.
Configuration Files
// openclaw.json
"agents": {
"defaults": {
"model": {
"primary": "zai/glm-5",
"fallbacks": ["openai-codex/gpt-5.4", "kimi-coding/k2p5", ...]
}
}
}
The bug occurs regardless of which provider is set as primary - it always uses the primary provider's prefix when switching to a different model.
Description
When switching models in the Control UI chat page, the model selector sends an incorrect provider prefix in the
sessions.patchrequest. It uses the current default provider's prefix instead of the selected model's actual provider prefix.Steps to Reproduce
zai,kimi-coding,openai-codex)zai/glm-5as the default modelhttp://127.0.0.1:18789/chatk2p5 · kimi-codingfrom the model dropdownExpected Behavior
The UI should send:
{"type":"sessions.patch","payload":{"session":"agent:main:main","model":"kimi-coding/k2p5"}}Actual Behavior
The UI sends:
{"type":"sessions.patch","payload":{"session":"agent:main:main","model":"zai/k2p5"}}This results in error:
Gateway Logs
Same issue occurs when switching to other models:
gpt-5.4 · openai-codexsendszai/gpt-5.4(wrong)openai-codex/gpt-5.4(correct)Workaround
Use CLI to switch models:
Environment
Root Cause Analysis
The model selector dropdown appears to be using the currently active/default provider prefix instead of the selected model's actual provider when constructing the
sessions.patchrequest payload.Looking at the UI code, the model dropdown correctly displays models with their provider suffix (e.g., "k2p5 · kimi-coding"), but when the selection is made, the provider resolution logic seems to default to the current primary provider rather than parsing the selected model's provider.
Configuration Files
The bug occurs regardless of which provider is set as primary - it always uses the primary provider's prefix when switching to a different model.