Agent thinking in codeblock

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Every once in a while the agents thinking process starts writing into a codeblock, making long single lines of the “thoughts”.

Steps to Reproduce

not 100% sure what triggers it but i think it happens when the agent thinking about literal code and place the code in the thought output, then if the line ends with code it will terminate with a ``` which leads to everything else landing in the codeblock

Expected Behavior

The codeblock shouldn’t be opened in this case, or the previous block should have been within the codeblock.

Screenshots / Screen Recordings

Operating System

Linux

Version Information

Version: 2.6.22
VSCode Version: 1.105.1
Commit: c6285feaba0ad62603f7c22e72f0a170dc8415a0
Date: 2026-03-27T15:59:31.561Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Linux x64 6.19.8-200.fc43.x86_64

For AI issues: which model did you use?

Opus 4.6 thinking, but it happens with every model afaik.

For AI issues: add Request ID with privacy disabled

320761e9-1470-4739-933a-08d225a55ef4

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the report and screenshot. This looks like a client-side rendering issue where code in the thinking output gets misinterpreted as a code block.

Could you update to the latest Cursor version? There have been several markdown rendering fixes in recent releases. If the issue persists after updating, reply here with a new request ID and we’ll dig deeper.

I tried to convince the agent to produce a paragraph in its thinking output that specifically ends in a code segment, after updating cursor the “Auto” model was selected and it failed horibly on this task, it didnt even write a paragraph with code. When i switched it to opus 4.6 thinking it said it would make some thinking paragraphs with code at the end of the paragraph but it didnt work because all this “thinking” ended up in final conclusion output which didnt show any code at all, it was all properly inlined.

However it still happens, see screenshot.

cursor info:
Version: 3.0.16
VSCode Version: 1.105.1
Commit: 475871d112608994deb2e3065dfb7c6b0baa0c50
Date: 2026-04-09T05:33:51.767Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Linux x64 6.19.11-200.fc43.x86_64