fix: Improve thinking tag removal with more aggressive cleaning

- Add multiple regex passes to handle various think tag scenarios
- Remove standalone <think> and </think> tags that might remain
- Clean leading whitespace after tag removal
- Add debug logging to track text cleaning process
- Handle streaming cases where tags appear before closing tags arrive

This provides more robust cleaning to ensure no think tags appear
in the final message content during streaming scenarios.
This commit is contained in:
Glen Maddern 2025-06-24 17:35:14 +10:00
commit 03dd988f35

View file

@ -34,7 +34,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
className={`
${
message.role === "user"
? "max-w-[80%] rounded-2xl px-3 py-2 border border-zinc-200/10 bg-zinc-100 text-black"
? "max-w-[80%] rounded-2xl px-3 py-2 border border-zinc-200/10 bg-white text-black"
: " text-zinc-900 w-full"
}`}
>