MoonshotAI / MoonshotAI/kimi-code
[kimi-web] Code blocks not syntax-highlighted after streaming finishes until page refresh
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?
- Start the local
apps/kimi-webdev server. - Send the message: "Give me 20 lines of TypeScript code".
- Wait for the streaming reply to finish.
- Observe the code block: it is likely plain black text on a light background, with no syntax highlighting.
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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