MoonshotAI / MoonshotAI/kimi-code

[kimi-web] Code blocks not syntax-highlighted after streaming finishes until page refresh

Open
#1,164 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?
kimi --version: 0.20.1

Which open platform/subscription were you using?
N/A (local kimi-web dev mode or 0.20.1).

Which model were you using?
Any model, e.g. kimi-k2.7.

What platform is your computer?
macOS, Chrome / Safari.

What issue are you seeing?
In the kimi-web chat UI, when the model streams a reply that contains a code block, the code block is rendered as plain text without syntax highlighting after streaming finishes. Refreshing the browser window makes the same code block highlight correctly.

What steps can reproduce the bug?

  1. Start the local apps/kimi-web dev server.
  2. Send the message: "Give me 20 lines of TypeScript code".
  3. Wait for the streaming reply to finish.
  4. Observe the code block: it is likely plain black text on a light background, with no syntax highlighting.
  5. Refresh the browser window; the code block now highlights correctly.

What is the expected behavior?
After streaming finishes, the code block should be syntax-highlighted by Shiki on the first render, without requiring a page refresh.

Additional information

  • The bug is intermittent but reproduces frequently during local debugging.
  • Highlighting works after refresh, so Shiki itself is functional; the issue is in the transition from streaming to final render.
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start the apps/kimi-web dev server and trace the chat response from streaming to its final render, focusing on where Shiki syntax highlighting is applied. Reproduce with a 20-line TypeScript response, then verify that the completed code block highlights on the first render without a browser refresh.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.