Skip to content

fix: prompt for Moonshot platform during setup (moonshot.cn support)#8166

Closed
konsisumer wants to merge 2 commits into
NousResearch:mainfrom
konsisumer:fix/moonshot-cn-endpoint-8096
Closed

fix: prompt for Moonshot platform during setup (moonshot.cn support)#8166
konsisumer wants to merge 2 commits into
NousResearch:mainfrom
konsisumer:fix/moonshot-cn-endpoint-8096

Conversation

@konsisumer

Copy link
Copy Markdown
Contributor

Summary

  • When a user selects Kimi/Moonshot and enters a non-sk-kimi- API key, setup now asks which platform the key was created on: moonshot.ai (global) or moonshot.cn (China)
  • The selected endpoint is persisted as KIMI_BASE_URL in .env, so runtime resolution picks it up automatically
  • Exports MOONSHOT_CN_BASE_URL constant (https://api.moonshot.cn/v1) for consistent use across the codebase

Test plan

  • Added TestMoonshotCnEndpoint test class with 4 tests covering credential resolution, status check, and URL override behavior
  • All 131 existing tests continue to pass

Closes #8096

@konsisumer konsisumer marked this pull request as ready for review April 12, 2026 05:35
… keys

Keys from platform.moonshot.cn only authenticate against api.moonshot.cn/v1,
but setup previously hardcoded api.moonshot.ai/v1 for all non-Kimi-Code keys,
causing a misleading 401 error. Now when a non-sk-kimi- key is entered, the
setup flow asks which platform the key was created on and persists the correct
base URL via KIMI_BASE_URL.

Closes NousResearch#8096
The @whiskeysockets/baileys package is a git-based npm dependency
(WhiskeySockets/Baileys#fix/abprops-abt-fetch) which requires git
to be available during npm install.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #9172 which takes the full dual-provider approach (separate kimi-coding-cn provider with KIMI_CN_API_KEY). This supports both international and China keys simultaneously via credential pool, which the setup-prompt approach couldn't. Thank you for the contribution @konsisumer!

@teknium1 teknium1 closed this Apr 13, 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.

[Config issue]: Kimi/Moonshot provider defaults to wrong endpoint for China users

2 participants