MoonshotAI / MoonshotAI/kimi-cli

/login device auth fails with HTTP 500 after successful browser approval (CLI v0.42.0, macOS)

Open
#2,638 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

Environment

  • CLI version: 0.42.0
  • OS: macOS
  • Account: free plan (Adagio tier)
  • Also reproduced via the VS Code extension

Steps to reproduce

  1. Run /login in the CLI
  2. Browser opens with a device code (e.g. WGBT-C3BW, QLE2-MYVL)
  3. Approve the login in the browser with the correct account — approval succeeds in the browser
  4. CLI then reports:
    Login failed: The server had an error while processing your request
    

Expected

Login completes and credentials are stored.

Actual

The token exchange after browser approval appears to return HTTP 500. Reproduced 3+ times with fresh device codes.

What I've ruled out

  • Stale local credentials: none exist — /logout returns "Nothing to logout"; no ~/.kimi or ~/.config/kimi directories
  • Network: no proxy/VPN; stable connection
  • Wrong account / expired codes: approved promptly with the correct account, multiple fresh codes
  • Account/quota health: the Kimi Work agent (desktop app) works perfectly on the same account at the same time, and My Quota shows ~50% remaining — so the model backend is fine; only the CLI device-auth token exchange fails

Because the failure happens after successful browser approval, and no CLI commands work without login, this looks like a server-side issue in the token-exchange step, possibly specific to my account.

Possibly related

The API-key path also fails for this account: requests return
429 ... account suspended due to insufficient balance
even though Billing & Invoices is empty (expected on a free plan). This hints the account's billing state may be mis-flagged server-side, which could be the root cause of both errors.

Request

Could you check server-side logs for failed token exchanges on my account? Happy to share my account email / org ID privately.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing /login on macOS with CLI v0.42.0 and compare the successful browser approval with the failing post-approval token exchange. The issue names no repository file or test entry point; done means identifying and resolving the HTTP 500 so credentials are stored and CLI login completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.