Skip to content

Commit e40fef2

Browse files
CCcassiusdjsclaude
andcommitted
fix(tui): show commentary-phase text when no final_answer blocks present
TUI was invisible for messages with only commentary-phase text blocks because extractAssistantVisibleText returned undefined when hasExplicitPhasedTextBlocks=true and no final_answer phase existed. Add commentary-phase fallback before unphased extraction so streaming deltas and final messages are visible during the commentary phase and when models omit the final-answer tag entirely. Fixes #34513, #35523, #37647, #40824, #34537 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 283b72f commit e40fef2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/shared/chat-message-content.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,11 @@ export function extractAssistantVisibleText(message: unknown): string | undefine
184184
if (finalAnswerText) {
185185
return finalAnswerText;
186186
}
187+
// Fall back to commentary-phase text when no final_answer blocks exist yet
188+
// (streaming in progress, or model omits <final> tags entirely).
189+
const commentaryText = extractAssistantTextForPhase(message, { phase: "commentary" });
190+
if (commentaryText) {
191+
return commentaryText;
192+
}
187193
return extractAssistantTextForPhase(message);
188194
}

0 commit comments

Comments
 (0)