#11526: fix(control-ui): hide tool-only assistant messages when thinking is off
app: web-ui
stale
Cluster:
UI Enhancements and Fixes
## Bug
When the thinking toggle is off, messages with role `toolresult` are correctly hidden. However, assistant messages that contain **only** tool calls (`toolcall`/`tool_call`/`tooluse`/`tool_use`) or `thinking` blocks are still displayed as empty bubbles in the chat.
## Fix
Add a check to also skip assistant messages where every content block is a tool call or thinking block, matching the existing behavior for toolresult messages.
## Changes
- `ui/src/ui/views/chat.ts`: Added filtering for tool-only assistant messages when `showThinking` is false
Small, surgical fix — one file, no new dependencies.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This change updates `buildChatItems` in `ui/src/ui/views/chat.ts` to additionally skip assistant messages when `showThinking` is false and the message’s `content` blocks are all tool-call or `thinking` blocks, preventing empty-looking chat bubbles.
The approach matches the existing behavior that already hides `toolresult` messages when thinking is off, but it currently relies on `raw.content` being a non-empty array, which may not cover all “empty bubble” shapes (e.g., assistant messages with missing/empty `content`).
<h3>Confidence Score: 4/5</h3>
- Generally safe to merge, but verify it covers all empty assistant-message shapes.
- The change is localized and low-impact, but the new filter only triggers when `raw.content` is a non-empty array; if the empty-bubble messages in practice have empty/missing content, the bug can persist and should be addressed before merge.
- ui/src/ui/views/chat.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#10996: fix(control-ui): hide tool call blocks when thinking/working toggle...
by Annaxiebot · 2026-02-07
88.9%
#11010: fix(control-ui): hide tool call cards when thinking toggle is off
by Annaxiebot · 2026-02-07
88.6%
#16733: fix(ui): avoid injected newlines when tool output is hidden
by jp117 · 2026-02-15
78.4%
#10097: fix: add empty thinking blocks to tool call messages when thinking is…
by cyxer000 · 2026-02-06
78.3%
#12079: TUI: improve thinking UX, tool readability, and live running status...
by rubenfb23 · 2026-02-08
77.1%
#6502: fix(tui): skip empty text for tool-only assistant turns
by douvy · 2026-02-01
76.6%
#17552: fix(agents): suppress tool error warnings when assistant already re...
by AytuncYildizli · 2026-02-15
75.1%
#20317: feat(webchat): add toggle to hide tool calls and thinking blocks
by nmccready · 2026-02-18
75.1%
#9248: Fix: Webchat UI goes grey/unresponsive after Slack message tool calls
by vishaltandale00 · 2026-02-05
74.9%
#21042: fix(ui): render images in tool result messages
by Mellowambience · 2026-02-19
74.7%