My guess would be the response text is passed through a rudimentary templating engine that looks for {
and }
. Somehow it must be processing the whole chat history. The templater fails at the unexpected braces in the code block and then just gives up (probably a try-catch ignores the error and sends the message anyway).
Imagine smearing shit all over your ass and feeling clean. If human shit fell on your floor, would you wipe it a few times with dry paper and say “good enough” or bring out a disinfectant spray?