fix(doctor): try China DashScope endpoint before declaring key invalid#18952
Closed
shellybotmoyer wants to merge 1 commit into
Closed
fix(doctor): try China DashScope endpoint before declaring key invalid#18952shellybotmoyer wants to merge 1 commit into
shellybotmoyer wants to merge 1 commit into
Conversation
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
Contributor
Author
|
Superseded by upstream commit 5ead126 which added the same DashScope China endpoint fallback logic plus tests. Closing in favor of upstream solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
When
DASHSCOPE_BASE_URLis 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 internationaldashscope-intl.aliyuncs.comendpoint. Users withoutDASHSCOPE_BASE_URLconfigured get a false(invalid API key)report fromhermes doctor.Fixes #18904