Skip to content

fix(doctor): try China DashScope endpoint before declaring key invalid#18952

Closed
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/doctor-dashscope-china-fallback
Closed

fix(doctor): try China DashScope endpoint before declaring key invalid#18952
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/doctor-dashscope-china-fallback

Conversation

@shellybotmoyer

Copy link
Copy Markdown
Contributor

Fix

When DASHSCOPE_BASE_URL is not set and the default intl endpoint (dashscope-intl.aliyuncs.com) returns 401, retry with the China endpoint (dashscope.aliyuncs.com) before declaring the key invalid.

If the China endpoint succeeds, show a hint: (China endpoint — set DASHSCOPE_BASE_URL) to guide the user toward proper configuration.

Why

China-region DashScope/Bailian API keys only work with dashscope.aliyuncs.com, not the international dashscope-intl.aliyuncs.com endpoint. Users without DASHSCOPE_BASE_URL configured get a false (invalid API key) report from hermes doctor.

Fixes #18904

When DASHSCOPE_BASE_URL is not set and the default intl endpoint returns 401, retry with dashscope.aliyuncs.com before reporting the key as invalid. Shows a hint to set DASHSCOPE_BASE_URL when the China endpoint succeeds.

Fixes NousResearch#18904
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard provider/qwen Qwen / Alibaba Cloud (OAuth) labels May 2, 2026
@shellybotmoyer

Copy link
Copy Markdown
Contributor Author

Superseded by upstream commit 5ead126 which added the same DashScope China endpoint fallback logic plus tests. Closing in favor of upstream solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/qwen Qwen / Alibaba Cloud (OAuth) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes doctor reports valid China DashScope API key as invalid

2 participants