fix(doctor): skip /models health-check for Alibaba dedicated tiers#20935
fix(doctor): skip /models health-check for Alibaba dedicated tiers#20935tfantas wants to merge 1 commit into
Conversation
|
Related to #20642 (which also fixes Gemini doctor probe with |
b061900 to
ea515e3
Compare
The doctor's API-key health-check loop GETs <base>/models, but Alibaba's dedicated-tier endpoints don't expose that route: - token-plan.<region>.maas.aliyuncs.com (Token Plan) - coding-intl.dashscope.aliyuncs.com (Coding Plan) Both return HTTP 404 even with a valid key, falsely tripping the health check. Treat them like MiniMax CN — show "(key configured — dedicated plan, /models n/a)" instead. Detection is hostname-based via the existing base_url_host_matches / base_url_hostname helpers, applied to either DASHSCOPE_BASE_URL / ALIBABA_CODING_PLAN_BASE_URL (when overridden) or the profile's default_url. Regular DashScope keys hitting dashscope-intl.aliyuncs.com are unaffected. Note: the Gemini Bearer→x-goog-api-key fix that originally accompanied this change was dropped — #20642 already lands the same fix with unit tests, so this PR is now Alibaba-only to avoid duplication.
ea515e3 to
a2b3ed7
Compare
|
Thanks @alt-glitch — good catch on the duplication. I've dropped the Gemini fix from this PR and force-pushed (commit Recommended order: merge #20642 first (it has unit tests for the Gemini fix), then this one. |
|
Reopening — I closed this prematurely last week, my bad. The Alibaba dedicated-tier skip in this PR is orthogonal to the Gemini header work in #20642 (still open), so it can land independently if useful — the hostname-based detection only touches the two @alt-glitch — happy to:
No objections either way — re-closing on request is fine. |
Summary
Alibaba's dedicated-tier endpoints don't expose
/models, so the doctor's API-key health-check loop returns HTTP 404 for valid keys:token-plan.<region>.maas.aliyuncs.com(Token Plan)coding-intl.dashscope.aliyuncs.com(Coding Plan)Same pattern as MiniMax CN — skip the check and show
(key configured — dedicated plan, /models n/a)instead of a false ⚠.Changes
hermes_cli/doctor.py: hostname-based skip applied to either the user'sDASHSCOPE_BASE_URL/ALIBABA_CODING_PLAN_BASE_URLoverride or the profile's default URL, before thehttpx.get(_url + "/models")call. Regular DashScope keys hittingdashscope-intl.aliyuncs.comare unaffected.Relation to #20642
The Gemini
Bearer → x-goog-api-keyfix that originally accompanied this PR has been dropped — #20642 lands the same fix with unit tests, so this PR is now Alibaba-only to avoid duplication. Recommend merging #20642 first.Verification
hermes doctoragainstDASHSCOPE_BASE_URL=https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1(Token Plan keysk-sp-…):GET <token-plan>/models(current behavior)Empirical probe also confirms
coding-intl.dashscope.aliyuncs.com/v1/modelsreturns 404, matching the same skip path.Test plan
hermes doctorwithDASHSCOPE_BASE_URL=https://token-plan.<region>.maas.aliyuncs.com/...→ expect✓ Alibaba/DashScope (key configured — dedicated plan, /models n/a)hermes doctorwithALIBABA_CODING_PLAN_API_KEY(default URLcoding-intl.dashscope.aliyuncs.com/v1) → expect✓ Alibaba Cloud (Coding Plan) (...)dashscope-intl.aliyuncs.com→ existing behavior preserved (200/401 based on key validity)