Skip to content

fix(tui): hide whitespace-only thinking from the transcript - #1829

Merged
RealKai42 merged 1 commit into
mainfrom
kaiyi/da-nang-v1
Jul 17, 2026
Merged

fix(tui): hide whitespace-only thinking from the transcript#1829
RealKai42 merged 1 commit into
mainfrom
kaiyi/da-nang-v1

Conversation

@RealKai42

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue. This fixes a rendering artifact reported from a real session: stray bullet lines containing only spaces appearing between tool calls.

Problem

Models occasionally stream whitespace-only thinking (e.g. a single space as the entire thinking content of a step). The TUI created a thinking draft/component for it, which renders as a stray bullet followed by a line padded with spaces — visible both while streaming and when replaying session history on resume. The space slips past the text component's blank check because the thinking text is wrapped in ANSI styling before the check runs, so the styled string is never whitespace-only after trimming.

What changed

  • Thinking deltas that are empty or whitespace-only no longer start a thinking draft or switch the live pane out of the waiting spinner (same treatment the existing guard already gave empty encrypted-reasoning deltas).
  • The thinking component funnel skips whitespace-only think text, so session replay never turns a stored whitespace-only think part into a bare bullet line.
  • UI-only: stored thinking is still replayed verbatim to the model; nothing changes on the wire or in persisted session records.
  • Added two regression tests: a whitespace-only streaming delta produces no component and keeps the waiting phase, and a whitespace-only think text through the replay funnel produces no component while real thinking still renders.

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.

Models occasionally stream whitespace-only thinking (e.g. a single
space). It starts a thinking draft that renders as a bare bullet line,
both while streaming and when replaying session history. Skip
whitespace-only thinking deltas before they create a draft, and skip
whitespace-only think text at the component funnel so stored
whitespace think parts never render on replay. Stored thinking is
still replayed verbatim to the model.
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ab1357c

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@ab1357c
npx https://pkg.pr.new/@moonshot-ai/kimi-code@ab1357c

commit: ab1357c

@RealKai42
RealKai42 merged commit 1b907b0 into main Jul 17, 2026
15 checks passed
@RealKai42
RealKai42 deleted the kaiyi/da-nang-v1 branch July 17, 2026 09:19
@github-actions github-actions Bot mentioned this pull request Jul 17, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Jul 17, 2026
…AI#1829)

Models occasionally stream whitespace-only thinking (e.g. a single
space). It starts a thinking draft that renders as a bare bullet line,
both while streaming and when replaying session history. Skip
whitespace-only thinking deltas before they create a draft, and skip
whitespace-only think text at the component funnel so stored
whitespace think parts never render on replay. Stored thinking is
still replayed verbatim to the model.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Jul 17, 2026
…AI#1829)

Models occasionally stream whitespace-only thinking (e.g. a single
space). It starts a thinking draft that renders as a bare bullet line,
both while streaming and when replaying session history. Skip
whitespace-only thinking deltas before they create a draft, and skip
whitespace-only think text at the component funnel so stored
whitespace think parts never render on replay. Stored thinking is
still replayed verbatim to the model.
ywh114 pushed a commit to ywh114/kimi-code that referenced this pull request Jul 19, 2026
…AI#1829)

Models occasionally stream whitespace-only thinking (e.g. a single
space). It starts a thinking draft that renders as a bare bullet line,
both while streaming and when replaying session history. Skip
whitespace-only thinking deltas before they create a draft, and skip
whitespace-only think text at the component funnel so stored
whitespace think parts never render on replay. Stored thinking is
still replayed verbatim to the model.
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.

1 participant