Skip to content

fix(doctor): skip pluggable provider profiles when a dedicated check exists (salvage #22529)#22801

Merged
teknium1 merged 2 commits into
mainfrom
salvage/pr-22529
May 9, 2026
Merged

fix(doctor): skip pluggable provider profiles when a dedicated check exists (salvage #22529)#22801
teknium1 merged 2 commits into
mainfrom
salvage/pr-22529

Conversation

@teknium1

@teknium1 teknium1 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Salvage of #22529hermes doctor no longer runs a duplicate anthropic (or openrouter / bedrock) check from the pluggable provider profile loop; the dedicated check is the only path used.

Root cause

hermes_cli/doctor.py::_build_apikey_providers_list walked all pluggable provider profiles (Anthropic, OpenRouter, Bedrock) AND emitted them into the apikey-loop, which already had dedicated checks elsewhere. The duplicate apikey-loop entry tried to validate using the wrong auth header (api-key style vs. OAuth token), produced HTTP 404, and surfaced as a confusing failure in hermes doctor even when the dedicated check passed.

Changes (contributor commits)

Picked over competing PR #22512 (ly82505129) for: includes Bedrock (which #22512 missed), alias-aware via normalize_provider (catches claude/claude-oauth profiles a pure display-name match misses), filters at the build phase (cleaner), ships regression tests. ly82505129 credited.

Validation

  • 106/106 doctor / apikey / pluggable tests pass on the salvage branch.

Closes #22346 via salvage.

…exists (#22346)

Problem
-------
`hermes doctor` ran two health checks for Anthropic: a dedicated one
with the correct `x-api-key` + `anthropic-version` headers, and a
generic Bearer-auth one driven by the pluggable `ProviderProfile` for
"anthropic". The generic check called `https://api.anthropic.com/v1/models`
with `Authorization: Bearer ...`, which Anthropic answers with HTTP 404,
producing a noisy duplicate warning even when the dedicated check passed.

Root cause
----------
`hermes_cli/doctor.py:_build_apikey_providers_list` deduplicated profiles
against a `_known_canonical` set built from the static list (Z.AI/GLM,
Kimi, DeepSeek, …). Providers with their own dedicated check above the
generic loop (Anthropic, OpenRouter, Bedrock) were not in that set, so
their profiles were appended and ran a second, broken check.

Fix
---
Add `{"anthropic", "openrouter", "bedrock"}` to the skip set, and
also skip profiles whose aliases match any of those names (e.g.
`claude`, `claude-oauth` → anthropic).

Tests
-----
tests/hermes_cli/test_doctor_dedicated_provider_skip.py:
  - test_build_apikey_providers_list_skips_dedicated_check_providers:
    asserts the assembled list does not contain anthropic, openrouter,
    or bedrock entries.
  - test_build_apikey_providers_list_includes_non_dedicated_providers:
    sanity guard that legitimate providers (DeepSeek, Z.AI/GLM) survive.
Both confirmed via stash-verify (fail pre-fix with anthropic/openrouter
leaking, pass post-fix).

Fixes #22346
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: salvage/pr-22529 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 7906 on HEAD, 7906 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4180 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1 teknium1 merged commit 6e848f6 into main May 9, 2026
16 of 18 checks passed
@teknium1 teknium1 deleted the salvage/pr-22529 branch May 9, 2026 20:36
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels May 9, 2026
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 type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes doctor: duplicate anthropic check fails with HTTP 404 (wrong auth header in pluggable provider check)

3 participants