Problem
/model Qwen (or any Alibaba model) fails with:
Error: Could not reach the Alibaba Cloud (DashScope) API to validate `qwen3.6-plus`. If the service isn't down, this model may not be valid.
Root Cause
The validate_requested_model() function in `hermes_cli/models.py` probes the provider's `/models` endpoint to verify model existence. However, DashScope's coding endpoint (`https://coding.dashscope.aliyuncs.com/v1\`) does not support the `/models` endpoint — it returns HTTP 404.
This means:
- `fetch_api_models()` returns `None` (can't reach API)
- Code falls through to line 2195-2202 which returns `{"accepted": False}`
- The model switch is hard-rejected
When This Broke
- Before commit `aeb53131f` (Apr 13, 2026), the "couldn't reach API" fallback returned `{"accepted": True, "persist": True}` with a warning — so model switching worked.
- Commit `aeb53131f` changed it to `{"accepted": False}` to prevent "fake models", but this broke providers that don't expose `/models` (DashScope coding endpoint being the main one).
Affected Users
Any user who:
- Has an Alibaba/DashScope coding plan account
- Sets `providers.alibaba.base_url` to `https://coding.dashscope.aliyuncs.com/v1\`
- Tries to switch models via `/model`
The classic endpoint (`dashscope.aliyuncs.com/compatible-mode/v1`) does support `/models` but requires a different API key.
Suggested Fix
Add provider-specific handling for `alibaba` in `validate_requested_model()` before the generic "couldn't reach" fallback, similar to how `bedrock` and `openai-codex` already have their own validation paths.
# DashScope coding endpoint does not expose /models (returns 404).
# Fall back to models.dev catalog for alibaba provider.
if normalized == "alibaba":
known = provider_model_ids("alibaba")
if requested in known:
return {"accepted": True, "persist": True, "recognized": True}
return {"accepted": True, "persist": True, "recognized": False, "message": "..."}
Reproduction
- Set in config.yaml:
```yaml
providers:
alibaba:
base_url: https://coding.dashscope.aliyuncs.com/v1
```
- Restart gateway
- Send `/model Qwen`
- Observe error instead of successful switch
Problem
/model Qwen(or any Alibaba model) fails with:Root Cause
The
validate_requested_model()function in `hermes_cli/models.py` probes the provider's `/models` endpoint to verify model existence. However, DashScope's coding endpoint (`https://coding.dashscope.aliyuncs.com/v1\`) does not support the `/models` endpoint — it returns HTTP 404.This means:
When This Broke
Affected Users
Any user who:
The classic endpoint (`dashscope.aliyuncs.com/compatible-mode/v1`) does support `/models` but requires a different API key.
Suggested Fix
Add provider-specific handling for `alibaba` in `validate_requested_model()` before the generic "couldn't reach" fallback, similar to how `bedrock` and `openai-codex` already have their own validation paths.
Reproduction
```yaml
providers:
alibaba:
base_url: https://coding.dashscope.aliyuncs.com/v1
```