Skip to content

fix(display): show spinners and tool progress during streaming mode#2161

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-6757a563
Mar 20, 2026
Merged

fix(display): show spinners and tool progress during streaming mode#2161
teknium1 merged 1 commit intomainfrom
hermes/hermes-6757a563

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

When streaming is enabled (display.streaming: true), the CLI was completely silent during API calls and tool execution — no thinking spinner in the TUI toolbar, no ┊ tool progress lines. Only the reasoning box and streamed response text appeared.

Root cause

Two blanket suppressions:

  1. Thinking spinner skipped — the spinner block was gated on not self._has_stream_consumers(), so in streaming mode no spinner ever appeared in the TUI toolbar. The raw KawaiiSpinner (stdout-based) genuinely conflicts with streamed tokens, but the thinking_callback (TUI toolbar widget) works fine alongside streaming.

  2. _vprint blanket-suppressed_vprint returned immediately when stream consumers existed, killing all tool progress output. But during tool execution, no tokens are actively streaming — printing is safe.

Fix

  1. Fire thinking_callback in streaming mode — the elif not self._has_stream_consumers() gate now only applies to the raw KawaiiSpinner. The thinking_callback fires regardless, so the TUI toolbar shows the kawaii spinner during API calls.

  2. _executing_tools flag_execute_tool_calls sets self._executing_tools = True (reset in finally). _vprint checks this flag and allows output when tools are running, even with stream consumers registered.

Test plan

python -m pytest tests/ -n0 -q  # 5524 passed

Visual verification: enable streaming (display.streaming: true), send a message that triggers tool calls — TUI toolbar should show spinner during API calls, and ┊ tool progress lines should appear during tool execution.

When streaming was enabled, two visual feedback mechanisms were
completely suppressed:

1. The thinking spinner (TUI toolbar) was skipped because the entire
   spinner block was gated on 'not self._has_stream_consumers()'.
   Now the thinking_callback fires in streaming mode too — the
   raw KawaiiSpinner is still skipped (would conflict with streamed
   tokens) but the TUI toolbar widget works fine alongside streaming.

2. Tool progress lines (the ┊ feed) were invisible because _vprint
   was blanket-suppressed when stream consumers existed. But during
   tool execution, no tokens are actively streaming, so printing is
   safe. Added an _executing_tools flag that _vprint respects to
   allow output during tool execution even with stream consumers
   registered.
@teknium1 teknium1 merged commit aa64163 into main Mar 20, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant