Elffuss BraidHub

kikocis/continue public

Merge pull request #7720 from QianKuang8/qian/fix-incorrect-tool-call-content

fix: Prevent tool content with <think> tags from triggering incorrect tool calls
Changeset855b7eb1d8320ffaf67b6bad2fb7aa649be08427c6b8f9cb291bd836b91cf279
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-12 21:05 -06:00
CommitterGitHub <noreply@github.com> · 2025-09-12 21:05 -06:00
Parents10c7e079de88, 626d9a0b7a02

Browse the files at this changeset

1 file changed

modified gui/src/redux/slices/sessionSlice.ts +2 −2
@@ -545,7 +545,7 @@
545545
546546 // OpenAI-compatible models in agent mode sometimes send
547547 // all of their data in one message, so we handle that case early.
548- if (messageContent) {
548+ if (messageContent && message.role !== "tool") {
549549 const thinkMatches = messageContent.match(
550550 /<think>([\s\S]*)<\/think>([\s\S]*)/,
551551 );
@@ -605,7 +605,7 @@
605605
606606 // Add to the existing message
607607 if (messageContent) {
608- if (messageContent.includes("<think>")) {
608+ if (messageContent.includes("<think>") && message.role !== "tool") {
609609 lastItem.reasoning = {
610610 startAt: Date.now(),
611611 active: true,