Fix Sonnet's regression with inserting `</parameter></invoke>` (#41800)

Sometimes, inside the edit agent, Sonnet thinks that it's doing a tool
call and closes its response with `</parameter></invoke>` instead of
properly closing </new_text>.

A better but more labor-intensive way of fixing this would be switching
to streaming tool calls for LLMs that support it.

Closes #39921

Release Notes:

- Fixed Sonnet's regression with inserting `</parameter></invoke>`
sometimes
3a058138c1Oleksiy Syvokon committed on 11/3/2025, 10:22:51 AM· committed by GitHubparentf2b5395
1 file changedLine totals unavailable