Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

feat(shell): stream thinking content to terminal in real-time - #1538

Open
FuryMartin wants to merge 1 commit into
MoonshotAI:mainfrom
FuryMartin:stream-thinking-output
Open

FuryMartin wants to merge 1 commit into
MoonshotAI:mainfrom
FuryMartin:stream-thinking-output

Conversation

@FuryMartin

@FuryMartin FuryMartin commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

Related Issue

Resolve #(issue_number)

Description

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@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: bdc780b3ac

ℹ️ 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 on lines +137 to +140
if self.is_think and self.raw_text:
return BulletColumns(
Markdown(self.raw_text, style="grey50 italic"),
bullet_style="grey50",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-render the live thought block after each streamed chunk

In the normal shell path we read the wire with merge=False (src/kimi_cli/ui/shell/__init__.py:467-468), so a reasoning turn arrives as many ThinkParts. _LiveView.append_content() only calls refresh_soon() when the block is created or its type changes, not after later append()s (src/kimi_cli/ui/shell/visualize.py:1298-1311). Because this code now materializes Markdown(self.raw_text, ...) inside compose(), the live view caches a snapshot of the first thought fragment and stays stale until some unrelated event (tool call, step end, etc.) forces a recomposition. In practice, long tool-free reasoning steps will appear to stop updating after the first chunk, so the new “real-time” thinking stream is incomplete in the default interactive shell.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant