Skip to content

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

Closed
sjz-ks wants to merge 1 commit into
NousResearch:mainfrom
sjz-ks:fix/kimi-cn-doctor
Closed

fix(cli): fix doctor checks for Kimi China credentials#9720
sjz-ks wants to merge 1 commit into
NousResearch:mainfrom
sjz-ks:fix/kimi-cn-doctor

Conversation

@sjz-ks

@sjz-ks sjz-ks commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Summary

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

  • treat KIMI_CN_API_KEY as a configured provider credential in .env
  • make the Kimi / Moonshot (China) API probe null-safe when no base URL override env var exists

The runtime provider path is unchanged. This only corrects doctor diagnostics.

Closes #9716.

Changes

  • add KIMI_CN_API_KEY to _PROVIDER_ENV_HINTS in hermes_cli/doctor.py
  • guard the base URL env lookup so base_env=None does not trigger TypeError
  • add regression tests for:
    • KIMI_CN_API_KEY env detection
    • Kimi China doctor probe no longer raising str expected, not NoneType

Validation

  • python -m pytest tests/hermes_cli/test_doctor.py -q19 passed
  • manual isolated repro with only KIMI_CN_API_KEY in .env now shows API key or custom endpoint configured
  • Kimi China doctor probe now hits https://api.moonshot.cn/v1/models without the previous Python exception
  • real runtime chat path still works with Kimi China credentials

Notes

I also checked full-suite behavior locally. The remaining local failures appear unrelated to this patch and are reproducible on a clean origin/main baseline in this macOS environment.

@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #9780. Your commit was cherry-picked onto current main with your authorship preserved in git log. Thanks for the clean fix, Kevin!

@teknium1 teknium1 closed this Apr 14, 2026
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

2 participants