Skip to content

fix(tui): drop misleading /login hint in /usage and /status before first message - #2752

Open
nothankyouzzz wants to merge 1 commit into
MoonshotAI:mainfrom
nothankyouzzz:fix/sessionless-usage-login-hint
Open

fix(tui): drop misleading /login hint in /usage and /status before first message#2752
nothankyouzzz wants to merge 1 commit into
MoonshotAI:mainfrom
nothankyouzzz:fix/sessionless-usage-login-hint

Conversation

@nothankyouzzz

Copy link
Copy Markdown

Related Issue

Resolve #2751

Problem

See linked issue.

What changed

The session-backed sections of /usage and /status loaded their data through requireSession() unconditionally. On the v2 engine the TUI starts session-less (the session is created lazily on the first message), so requireSession() throws No active session. Send /login to login. — correct on the v1 engine where a missing session means the user is not signed in, but wrong here.

Both loaders now skip the session-backed section when the v2 engine has no session yet: /usage falls back to the existing muted No token usage recorded yet. line and /status simply omits the warning row (its Session row already shows none). The account-level Plan usage section is unaffected, and the v1 engine keeps the /login hint. /usage deliberately stays out of the lazy-creation command set — viewing usage should not create a session.

Added unit tests covering both commands on both engines.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c1f7806

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06a49a3153

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/commands/info.ts
…rst message

On the v2 engine the session is created lazily on the first message, so a
missing session is not a sign-in problem: guard requireSession behind a
session-less check in both reports. Both commands also wait out an
in-flight lazy creation first, so a /usage or /status typed right behind
the first prompt reports the about-to-exist session instead of the
session-less case.
@nothankyouzzz
nothankyouzzz force-pushed the fix/sessionless-usage-login-hint branch from 06a49a3 to c1f7806 Compare August 9, 2026 08:02
@nothankyouzzz

Copy link
Copy Markdown
Author

@chatgpt-codex-connector Good catch on the in-flight lazy creation race — fixed in c1f7806. loadRuntimeStatusReport now awaits host.waitForLazyCreation() before the session-less guard, so a /status typed right behind the first prompt waits out the in-flight creation and reports the real session instead of rendering Session none. Applied the same wait to loadSessionUsageReport, which had the identical race, and added regression tests for both in-flight cases.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

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.

/usage and /status incorrectly prompt to /login before the first message

1 participant