Skip to content

feat: render Markdown in Agents chat user messages - #31586

Merged
sreya merged 3 commits into
mainfrom
fix/agents-user-message-code-highlighting
Nov 3, 2026
Merged

sreya merged 3 commits into
mainfrom
fix/agents-user-message-code-highlighting

Conversation

@sreya

@sreya sreya commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

User messages rendered as plain text, so inline code, fenced code blocks, and other Markdown showed raw. They now render through the same Response renderer as assistant messages, with Shiki highlighting.

File reference and skill chips stay inline: the text parts and chips are joined into one Markdown source with a private-use placeholder per chip, and a rehype plugin resolves each placeholder to the chip. Inside fenced code a chip resolves to its plain text. Typed placeholder delimiters, including numeric character references, are escaped so text cannot forge a chip, and an autolink that touches a chip ends before it. remark-breaks keeps single newlines as line breaks, and user links get the same urlTransform as assistant links.

Generated by Coder Agents.

User messages rendered as plain text, so inline code, fenced code blocks,
and other Markdown showed raw. They now render through the same Response
renderer as assistant messages, with Shiki highlighting.

File reference and skill chips stay inline: the text parts and chips are
joined into one Markdown source with a private-use placeholder per chip,
and a rehype plugin resolves each placeholder to the chip. Inside fenced
code a chip resolves to its plain text. Typed placeholder delimiters,
including numeric character references, are escaped so text cannot forge
a chip, and an autolink that touches a chip ends before it. remark-breaks
keeps single newlines as line breaks, and user links get the same
urlTransform as assistant links.

Generated by Coder Agents.
@sreya sreya changed the title feat): render Markdown in Agents chat user messages feat: render Markdown in Agents chat user messages Oct 30, 2026
…rendering

Response now takes a list of text and chips directly, so the marker
format and escaping stay private to inlineNodes.ts. Marker spans keep
their text, which removes the code block special case. Tests now go
through the real Markdown pipeline, and comments use plain language.

Generated by Coder Agents.
@sreya
sreya marked this pull request as ready for review October 30, 2026 23:47
@sreya
sreya requested a review from a team as a code owner October 30, 2026 23:47
…ge-code-highlighting

# Conflicts:
#	site/pnpm-lock.yaml
@sreya
sreya merged commit 1a963c6 into main Nov 3, 2026
27 of 28 checks passed
@sreya
sreya deleted the fix/agents-user-message-code-highlighting branch November 3, 2026 18:30
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
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.

2 participants