Skip to content

fix(server): tell agents how to nest fenced code inside code blocks - #1

Open
pc-style wants to merge 21 commits into
mainfrom
t3code/fix-markdown-code-blocks
Open

fix(server): tell agents how to nest fenced code inside code blocks#1
pc-style wants to merge 21 commits into
mainfrom
t3code/fix-markdown-code-blocks

Conversation

@pc-style

@pc-style pc-style commented Sep 9, 2026

Copy link
Copy Markdown
Owner

When an agent replies with a code block that itself contains a fenced block (a prompt to paste, a README snippet), the chat renders it broken: the inner closing fence ends the outer block and the rest of the content spills out as plain prose. The renderer is right, that is standard CommonMark. The agent just never knew it had to use a longer fence.

This adds one sentence to the shared runtime instructions every provider adapter appends (Codex, Claude, Cursor, Grok, OpenCode, Antigravity): a code block containing triple backticks must be fenced with four backticks or ~~~. No parser change, since diverging from CommonMark would break copy/paste round-trips with GitHub and every other markdown surface.

Validation:

  • vp test run apps/server/src/provider/RuntimeInstructions.test.ts passes (6 tests, including a new one for the guidance).

Done with Claude Fable 5.1 in Claude Code.

🤖 Generated with Claude Code

@pc-style

pc-style commented Sep 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@pc-style
pc-style force-pushed the t3code/fix-markdown-code-blocks branch from f4a9b2b to c79ab38 Compare September 9, 2026 23:45
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.

6 participants