Skip to content

Moonshot wizard sets .cn baseUrl — silent 401 for international API keys #6222

@gregjrothwell

Description

@gregjrothwell

Bug Description

The onboarding wizard auto-populates https://api.moonshot.cn/v1 as the baseUrl when configuring the Moonshot/Kimi provider. For users with API keys created on the international platform (platform.moonshot.ai), this endpoint returns 401 Invalid Authentication — but Clawdbot surfaces zero error output. The model silently fails to respond.

Steps to Reproduce

  1. Run clawdbot onboard and configure Moonshot Kimi as a provider
  2. Enter a valid API key from platform.moonshot.ai
  3. Wizard saves baseUrl as https://api.moonshot.cn/v1 in clawdbot.json
  4. Attempt to use the Moonshot model (e.g. as a fallback)
  5. Model silently fails — no error in console, no logs, nothing

Expected Behavior

  • Wizard should default to https://api.moonshot.ai/v1 (the international endpoint)
  • If the endpoint returns 401, Clawdbot should log the error visibly and notify the user
  • Ideally: wizard validates the endpoint with a /v1/models call before saving config

Actual Behavior

  • api.moonshot.cn/v1 returns 401 Invalid Authentication
  • Clawdbot shows no error — complete silence
  • User has no way to diagnose the issue without manually curl-testing endpoints

Verification

# .cn endpoint — FAILS (401)
curl -s https://api.moonshot.cn/v1/models -H "Authorization: Bearer $KEY"
# {"error":{"message":"Invalid Authentication","type":"invalid_authentication_error"}}

# .ai endpoint — WORKS (200)
curl -s https://api.moonshot.ai/v1/models -H "Authorization: Bearer $KEY"
# Returns model list successfully

Impact

  • 2+ hours of debugging time lost
  • User topped up $100 in credits thinking it was a billing/tier issue
  • Silent failure makes this nearly impossible to self-diagnose

Suggested Fix

  1. Default Moonshot baseUrl to https://api.moonshot.ai/v1
  2. Surface HTTP error responses (especially 401) in console/logs
  3. Validate provider URL at config time with a lightweight API call

Environment

  • Clawdbot: 2026.1.24-3
  • OS: macOS
  • Node: v24.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions