#6502: fix(tui): skip empty text for tool-only assistant turns
Cluster:
TUI and Tool Execution Fixes
Tool-only turns showed "(no output)" in the TUI, confusing users during multi-step operations. Return empty string from resolveFinalAssistantText and guard finalizeAssistant with if(finalText), matching the pattern in tui-session-actions.ts.
Fixes #3361
🤖 AI-assisted: Built with Claude Code (claude-opus-4-5) Testing: Fully tested - lint, build, and all tests pass The contributor understands and has reviewed all code changes.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adjusts TUI rendering for assistant turns that contain no user-visible text (e.g., tool-only runs). `resolveFinalAssistantText` now returns an empty string instead of the literal "(no output)", and the chat event handler skips calling `chatLog.finalizeAssistant` when the finalized text is empty, preventing confusing placeholder output during multi-step operations.
These changes fit into the existing TUI streaming/finalization flow (`TuiStreamAssembler` → `ChatLog` updates) by treating “no content” as “render nothing”, consistent with other guards in the TUI that already skip empty delta updates.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is small, localized to TUI formatting/finalization, and aligns with existing patterns (skipping empty delta updates). It should only suppress a placeholder string and avoid finalizing empty assistant messages; no behavioral changes to tool streaming or error handling were introduced.
- No files require special attention
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#12974: fix: intermittent (no output) reported by users
by vincentkoc · 2026-02-10
85.1%
#6819: fix(tui): handle unstructured tool results and errors in tool execu...
by TreyDong · 2026-02-02
81.9%
#4495: Fix: emit final assistant event when reply tags hide stream
by ukeate · 2026-01-30
80.6%
#20516: fix(tui): preserve streamed text on finalize for pure text responses
by MisterGuy420 · 2026-02-19
80.1%
#18942: fix(tui): trigger render after finalizing chat assistant message
by BinHPdev · 2026-02-17
80.0%
#16733: fix(ui): avoid injected newlines when tool output is hidden
by jp117 · 2026-02-15
79.7%
#9220: Fix: TUI drops API responses silently when runID already finalized
by vishaltandale00 · 2026-02-05
79.0%
#8493: fix(tui): filter NO_REPLY token from chat display
by gavinbmoore · 2026-02-04
78.7%
#10996: fix(control-ui): hide tool call blocks when thinking/working toggle...
by Annaxiebot · 2026-02-07
77.5%
#17647: fix: Display error messages instead of (no output) for non-Claude m...
by MisterGuy420 · 2026-02-16
77.1%