diff --git a/web/frontend/src/features/chat/assistant-message-state.ts b/web/frontend/src/features/chat/assistant-message-state.ts index 9c9bf0428..b38b9c3a4 100644 --- a/web/frontend/src/features/chat/assistant-message-state.ts +++ b/web/frontend/src/features/chat/assistant-message-state.ts @@ -1,5 +1,8 @@ -import type { AssistantMessageKind, ChatMessage } from "../../store/chat.ts" -import { parseToolCallsFromContent, parseToolCallsValue } from "./tool-calls.ts" +import { + parseToolCallsFromContent, + parseToolCallsValue, +} from "@/features/chat/tool-calls.ts" +import type { AssistantMessageKind, ChatMessage } from "@/store/chat.ts" type AssistantToolCalls = ChatMessage["toolCalls"] type ExistingAssistantMessageState = Pick diff --git a/web/frontend/src/features/chat/tool-calls.ts b/web/frontend/src/features/chat/tool-calls.ts index e92dca1bb..c3b9b4777 100644 --- a/web/frontend/src/features/chat/tool-calls.ts +++ b/web/frontend/src/features/chat/tool-calls.ts @@ -4,7 +4,8 @@ function parseLegacyToolFeedbackContent( content: string, ): ChatToolCall[] | undefined { const trimmed = content.trim() - const match = /^🔧\s+`([^`]+)`(?:\n([\s\S]*))?$/.exec(trimmed) + const match = + /^🔧\s+`([^`\n\r]*?)(?:\.{1,2})?`[^\n\r]*(?:\r?\n([\s\S]*))?$/.exec(trimmed) if (!match) { return undefined }