Skip to content

fix(doctor): skip /models health-check for Alibaba dedicated tiers#20935

Closed
tfantas wants to merge 1 commit into
NousResearch:mainfrom
tfantas:fix/doctor-gemini-auth-and-alibaba-dedicated
Closed

fix(doctor): skip /models health-check for Alibaba dedicated tiers#20935
tfantas wants to merge 1 commit into
NousResearch:mainfrom
tfantas:fix/doctor-gemini-auth-and-alibaba-dedicated

Conversation

@tfantas

@tfantas tfantas commented May 6, 2026

Copy link
Copy Markdown

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's DASHSCOPE_BASE_URL / ALIBABA_CODING_PLAN_BASE_URL override or the profile's default URL, before the httpx.get(_url + "/models") call. Regular DashScope keys hitting dashscope-intl.aliyuncs.com are unaffected.

Relation to #20642

The Gemini Bearer → x-goog-api-key fix 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 doctor against DASHSCOPE_BASE_URL=https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 (Token Plan key sk-sp-…):

Method Result
GET <token-plan>/models (current behavior) HTTP 404 → ⚠
Skip + report key configured (this PR)

Empirical probe also confirms coding-intl.dashscope.aliyuncs.com/v1/models returns 404, matching the same skip path.

Test plan

  • hermes doctor with DASHSCOPE_BASE_URL=https://token-plan.<region>.maas.aliyuncs.com/... → expect ✓ Alibaba/DashScope (key configured — dedicated plan, /models n/a)
  • hermes doctor with ALIBABA_CODING_PLAN_API_KEY (default URL coding-intl.dashscope.aliyuncs.com/v1) → expect ✓ Alibaba Cloud (Coding Plan) (...)
  • Regular DashScope key against dashscope-intl.aliyuncs.com → existing behavior preserved (200/401 based on key validity)

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard provider/gemini Google Gemini (AI Studio, Cloud Code) P2 Medium — degraded but workaround exists labels May 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #20642 (which also fixes Gemini doctor probe with x-goog-api-key). This PR adds the Alibaba dedicated-tier skip on top. Consider merging or coordinating — Gemini fix is duplicated between the two.

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.
@tfantas tfantas force-pushed the fix/doctor-gemini-auth-and-alibaba-dedicated branch from ea515e3 to a2b3ed7 Compare May 7, 2026 15:05
@tfantas tfantas changed the title fix(doctor): use x-goog-api-key for Gemini health-check; skip /models for Alibaba dedicated tiers fix(doctor): skip /models health-check for Alibaba dedicated tiers May 7, 2026
@tfantas

tfantas commented May 7, 2026

Copy link
Copy Markdown
Author

Thanks @alt-glitch — good catch on the duplication. I've dropped the Gemini fix from this PR and force-pushed (commit a2b3ed749); now scoped to the Alibaba dedicated-tier skip only, which #20642 doesn't cover. Title and description updated to reflect.

Recommended order: merge #20642 first (it has unit tests for the Gemini fix), then this one.

@tfantas

tfantas commented May 15, 2026

Copy link
Copy Markdown
Author

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 *.aliyuncs.com dedicated-tier paths.

@alt-glitch — happy to:

  1. Rebase onto current main and request a reviewer, or
  2. Hold until fix: harden gateway SMS opt-out and Gemini doctor probe #20642 lands first per your earlier suggestion and fold the Alibaba bit into a follow-up.

No objections either way — re-closing on request is fine.

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 P2 Medium — degraded but workaround exists provider/gemini Google Gemini (AI Studio, Cloud Code) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants