Skip to content

fix(cli): fix doctor checks for Kimi China credentials#9780

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-2d57372e
Apr 14, 2026
Merged

fix(cli): fix doctor checks for Kimi China credentials#9780
teknium1 merged 1 commit into
mainfrom
hermes/hermes-2d57372e

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of PR #9720 by @sjz-ks (cherry-picked onto current main). Closes #9716.

Fixes two hermes doctor false-negative bugs for kimi-coding-cn / Moonshot China credentials:

  1. Missing env hint: KIMI_CN_API_KEY was not in _PROVIDER_ENV_HINTS, so _has_provider_env_config() returned False for China-only Kimi setups — doctor tells users to run hermes setup even though their key is configured.

  2. Null-safety crash: The Kimi China entry in _apikey_providers has base_env=None (correct — no user-configurable base URL override for the China endpoint), but os.getenv(_base_env, "") crashes with TypeError: str expected, not NoneType.

Changes (2 lines of production code)

  • Add "KIMI_CN_API_KEY" to _PROVIDER_ENV_HINTS
  • Guard: os.getenv(_base_env, "") if _base_env else ""
  • 2 regression tests added

Test plan

python -m pytest tests/hermes_cli/test_doctor.py -q → 19 passed

@teknium1 teknium1 merged commit 7061187 into main Apr 14, 2026
6 of 7 checks passed
@teknium1 teknium1 deleted the hermes/hermes-2d57372e branch April 14, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes doctor does not detect KIMI_CN_API_KEY and breaks the Kimi / Moonshot (China) probe

1 participant