Elffuss BraidHub

kikocis/continue public

fix: Prevent tool content with <think> tags from triggering incorrect tool calls
Changeset626d9a0b7a0232312b764dbe817d80309e727736a2bdbee3bddbe9e41c87dcca
AuthorQian <qk2004@nyu.edu> · 2025-09-12 17:45 +08:00
CommitterQian <qk2004@nyu.edu> · 2025-09-12 17:45 +08:00
Parents1ead4494745b

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,