Skip to content

feat(tui): add stats display mode for live thinking - #2921

Open
jfwang-moonshot wants to merge 5 commits into
MoonshotAI:mainfrom
jfwang-moonshot:feat/thinking-live-stats
Open

feat(tui): add stats display mode for live thinking#2921
jfwang-moonshot wants to merge 5 commits into
MoonshotAI:mainfrom
jfwang-moonshot:feat/thinking-live-stats

Conversation

@jfwang-moonshot

@jfwang-moonshot jfwang-moonshot commented Aug 14, 2026

Copy link
Copy Markdown

Related Issue

Resolves #287

Problem

What changed

Add a thinking_live_display preference in tui.toml. The default "preview" keeps the scrolling two-line tail while thinking streams; "stats" hides the text and shows the elapsed thinking time instead, leaving a one-line "Thought for …" summary once thinking finishes (Ctrl-O reveals the streaming text in both modes). Replayed thinking has no persisted duration, so those blocks show a plain "Thought for a while" summary instead of a fabricated 0s.

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.

Add a thinking_live_display preference in tui.toml. The default "preview"
keeps the scrolling two-line tail while thinking streams; "stats" hides
the text and shows an approximate token count plus elapsed thinking time,
leaving a one-line "Thought for …" summary once thinking finishes.
@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 865384e

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: 2c02d8f7cc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/config.ts Outdated
Comment thread apps/kimi-code/src/tui/controllers/streaming-ui.ts Outdated
Comment thread apps/kimi-code/src/tui/components/messages/thinking.ts Outdated
jfwang-moonshot and others added 4 commits August 17, 2026 15:24
Thinking durations are not persisted, so replayed blocks in stats mode
finalized with a fabricated "Thought for 0s". Replayed blocks are now
marked untimed and render "Thought for a while" instead; live blocks
keep the exact elapsed time.

Also switch ThinkingComponent to an options bag (mode / ui / liveDisplay /
timed), matching the options-object pattern used by other components with
multiple configuration knobs.
…ences

currentTuiConfig omitted the new field, so any save path that rewrites
tui.toml without touching it (/theme, /editor, the update preference, the
cache-expiry "never" action) re-serialized the key as "preview" and
silently reset a "stats" opt-in.
The chars/4 estimate could not be reconciled with real usage (per-chunk
usage is collected by providers but only surfaces at step end), so the
live stats line now shows just the exact elapsed time. ctrl+o during a
live stats block now falls back to the preview tail, matching preview
mode's behavior.
@bj456736

Copy link
Copy Markdown
Contributor

建议同步一下 PR 描述(token 估算已在 865384e 移除),"What changed" 可改为:

Add a thinking_live_display preference in tui.toml. The default "preview" keeps the scrolling two-line tail while thinking streams; "stats" hides the text and shows the elapsed thinking time instead, leaving a one-line "Thought for …" summary once thinking finishes (Ctrl-O reveals the streaming text in both modes). Replayed thinking has no persisted duration, so those blocks show a plain "Thought for a while" summary instead of a fabricated 0s.

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.

Toggle to disable thinking content

2 participants