I have a python script which contains: a triple-quoted docstring, with a triple-backtick code block inside it. Basically putting an example code block into the docstring.
In any case, this has nothing to do with """, if you add ``` code blocks, and ask for changes, the output of the agent's "code blocks" don't seem to be escaped properly, so it closes the actual code block and everything else renders as markdown below it. I don't recall this happening with the old agent ui.
Example thread: https://assistant.kagi.com/share/e3e13e61-e2da-415d-9d86-3b7e13ab61fa

the updated script should be rendered inside a single code block - any type of code output by the agent should never escape its own code blocks.