MoonshotAI / MoonshotAI/kimi-cli
/login device auth fails with HTTP 500 after successful browser approval (CLI v0.42.0, macOS)
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
- Run
/loginin the CLI - Browser opens with a device code (e.g.
WGBT-C3BW,QLE2-MYVL) - Approve the login in the browser with the correct account — approval succeeds in the browser
- 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 —
/logoutreturns "Nothing to logout"; no~/.kimior~/.config/kimidirectories - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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