Bug Description
hermes doctor reports a valid China-region Alibaba DashScope/Bailian API key as invalid.
Observed output:
Checking Alibaba/DashScope API...
✗ Alibaba/DashScope (invalid API key)
However, the same DASHSCOPE_API_KEY succeeds against China-region DashScope/Bailian endpoints and WebSearch MCP.
Verification Results
The following checks were run locally with the same key, without exposing the key value:
GET https://dashscope.aliyuncs.com/compatible-mode/v1/models -> HTTP 200
GET https://dashscope.aliyuncs.com/api/v1/models -> HTTP 200
POST https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp -> HTTP 200
The MCP initialize response also returns a normal BaiLianMcpServer serverInfo payload.
Suspected Root Cause
In hermes_cli/doctor.py, the Alibaba/DashScope API-key health check appears to default to:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1/models
For China-region DashScope/Bailian keys, the working endpoint is:
https://dashscope.aliyuncs.com/compatible-mode/v1/models
So the current doctor output can misclassify a region/endpoint mismatch as an invalid API key.
Expected Behavior
hermes doctor should not report a valid China-region DashScope key as invalid. Possible fixes:
- Respect
DASHSCOPE_BASE_URL when configured.
- Try both
dashscope-intl.aliyuncs.com and dashscope.aliyuncs.com before declaring the key invalid.
- If only one region fails, show a region/endpoint mismatch warning instead of
(invalid API key).
- Optionally verify WebSearch MCP separately when the key is being used for MCP services rather than model inference.
Related Issues
Environment
- Hermes Agent on macOS
DASHSCOPE_API_KEY configured in .env
- China-region DashScope/Bailian endpoints respond successfully
hermes doctor still reports Alibaba/DashScope (invalid API key)
No API keys or tokens are included in this report.
Bug Description
hermes doctorreports a valid China-region Alibaba DashScope/Bailian API key as invalid.Observed output:
However, the same
DASHSCOPE_API_KEYsucceeds against China-region DashScope/Bailian endpoints and WebSearch MCP.Verification Results
The following checks were run locally with the same key, without exposing the key value:
The MCP initialize response also returns a normal
BaiLianMcpServerserverInfo payload.Suspected Root Cause
In
hermes_cli/doctor.py, the Alibaba/DashScope API-key health check appears to default to:For China-region DashScope/Bailian keys, the working endpoint is:
So the current doctor output can misclassify a region/endpoint mismatch as an invalid API key.
Expected Behavior
hermes doctorshould not report a valid China-region DashScope key as invalid. Possible fixes:DASHSCOPE_BASE_URLwhen configured.dashscope-intl.aliyuncs.comanddashscope.aliyuncs.combefore declaring the key invalid.(invalid API key).Related Issues
Environment
DASHSCOPE_API_KEYconfigured in.envhermes doctorstill reportsAlibaba/DashScope (invalid API key)No API keys or tokens are included in this report.