Fix Gemini legacy thought message formatting#71
Conversation
Code Review —
|
… add unit tests
- Unify server/client splitLegacyGeminiThoughtContent to return { content, isThinking } objects
- Extract buildAssistantMessages helper to eliminate 5 duplicate legacy segment patterns
- Add vitest with 24 unit tests covering splitLegacyGeminiThoughtContent, buildAssistantMessages, and normalizePersistedGeminiAssistantEntries
- Add safety comment on finalizeStreamingMessage for non-Gemini provider compatibility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… parser, revert unintended unescapeWithMathProtection - Add role: 'assistant' to thinking entries in normalizePersistedGeminiAssistantEntries - Extract splitLegacyGeminiThoughtContent into shared/geminiThoughtParser.js to eliminate server/client duplication - Revert unescapeWithMathProtection from handleSimpleAssistantMessage and structured-data text handler (was unintentionally added to previously untouched code paths) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
[Thought: true]assistant text into proper thinking vs final message blocks in the chat UITesting