Skip to content

fix(web): coalesce streamed text chunks in history reloads - #2509

Open
mangeshraut712 wants to merge 1 commit into
MoonshotAI:mainfrom
mangeshraut712:cursor/fix-web-history-text-coalesce-7813
Open

fix(web): coalesce streamed text chunks in history reloads#2509
mangeshraut712 wants to merge 1 commit into
MoonshotAI:mainfrom
mangeshraut712:cursor/fix-web-history-text-coalesce-7813

Conversation

@mangeshraut712

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • pnpm exec vitest run test/turn-logic.test.ts in apps/kimi-web (37 passed)

Fixes #2505

History mapped each stream delta to its own content part and joined
them with newlines under pre-wrap, so reloads showed one line per
chunk. Coalesce consecutive same-kind parts within a message like the
live path (fixes MoonshotAI#2505).
@changeset-bot

changeset-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 09e6a33

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 Aug 1, 2026

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

commit: 09e6a33

@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: 09e6a339ac

ℹ️ 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 on lines +656 to +657
coalesceText = true;
coalesceThinking = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset coalescing at empty content-part boundaries

When a message contains text('before'), an empty thinking part, then text('after'), coalesceText remains true because the flags change only inside the non-empty branch, so the result becomes beforeafter instead of preserving the content-block boundary. Empty boundary parts are valid—for example, the OpenAI Responses adapter emits an empty thinking part when a reasoning-summary part starts—so reset both flags whenever the part type changes, before checking whether its payload is empty.

Useful? React with 👍 / 👎.

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.

[kimi-web] Reloaded transcript renders each streamed text chunk on its own line (newline-join + pre-wrap)

1 participant