MoonshotAI / MoonshotAI/kimi-code
/usage and /status incorrectly prompt to /login before the first message
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Description
Right after starting kimi, before sending the first message, running /usage shows:
Session usage
No active session. Send /login to login.
/status shows the same text as a Warning row.
This is misleading: the user is signed in (the Plan usage section of the same panel loads account quotas fine). The actual reason is that on the v2 engine the session is created lazily on the first message — the startup screen itself says No session yet — one will be created on your first message. — so there is simply no session yet.
Steps to reproduce
- Log in, then start
kimi. - Before sending any message, run
/usage(or/status).
Expected
The session-scoped sections degrade gracefully, e.g. /usage shows No token usage recorded yet. and /status shows no login warning, since being session-less at this point is normal.
Actual
Both commands surface requireSession()'s No active session. Send /login to login. error, which only makes sense on the v1 engine where a missing session means the user is not signed in.
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 tracing the /usage and /status commands to requireSession() and compare their v2-engine behavior with the startup message stating that a session is created on the first message. Verify the session-scoped output before the first message and confirm that the Plan usage section still loads account quotas. Done means no misleading login warning and graceful no-usage output when no session exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100