Conversation
|
Update: after extensive testing with @q4220, we've confirmed the root cause. The spinner writes directly to the terminal using \r inside prompt_toolkit's Current fixes in this PR:
HERMES_SPINNER_PAUSE=1 env var can be used as a workaround to disable Proper long-term fix would be integrating the thinking spinner as a |
|
@q4220 great to hear! Glad it's working now 🙏 For anyone following along — the fix was moving the spinner from raw \r |
|
well done, awesome job. So often the little things are hard hey. So just to be clear, the spinner is not appearing but there is no flashing and the thinking text is there. However, it seems as though a line of thinking text is persisting after the agent turn is complete as shown in the image |
|
@q4220 pushed a fix for the persisting thinking text — spinner now clears git fetch ygd58 Let us know! 🙏 |
4bfec38 to
72c7305
Compare
… widget Cherry-picked and improved from PR #470 (fixes #464). Problem: On Ubuntu 24.04 with ghostty + tmux, the prompt input box border lines flash due to cursor blink and raw spinner terminal writes conflicting with prompt_toolkit's rendering. Changes: - cli.py: Add CursorShape.BLOCK to Application() to disable cursor blink - cli.py: Add thinking_callback + spinner_widget in TUI layout so thinking status displays as a proper prompt_toolkit widget instead of raw terminal writes that conflict with the TUI renderer - run_agent.py: Add thinking_callback parameter to AIAgent; when set, uses the callback instead of KawaiiSpinner for thinking display What was NOT changed (preserving existing behavior): - agent/display.py: Untouched. KawaiiSpinner _write() stdout capture, _animate() logic, and 0.12s frame interval all preserved. This protects subagent stdout redirection and keeps smooth animations for non-CLI contexts (gateway, batch runner). - Original emoji spinner types (brain/sparkle/pulse/moon/star) preserved for all non-CLI contexts. Fixes from original PR #470: - CursorShape.STEADY_BLOCK -> CursorShape.BLOCK (STEADY_BLOCK doesn't exist in prompt_toolkit 3.0.52) - Removed duplicate self._spinner_text = '' line - Removed redundant nested if-checks Tested: 2706 tests pass, interactive CLI verified via tmux.
…der flashing Root cause: spinner was writing \r directly to terminal inside patch_stdout context, triggering full prompt_toolkit layout redraws on every frame. Changes: - cli.py: Add _on_thinking() callback, spinner_widget as FormattedTextControl Window in HSplit layout, CursorShape.STEADY_BLOCK, clear spinner on finish - run_agent.py: Pass thinking_callback to agent, remove KawaiiSpinner calls - agent/display.py: Remove cursor escape codes that leaked as raw text, use patch_stdout-aware stdout writes, slower frame rate (0.25s) Tested with @q4220 on Ubuntu 24.04 ghostty+tmux — no flashing, thinking text visible, clears correctly after agent finishes. Fixes NousResearch#464
72c7305 to
76af49b
Compare
|
Thanks for submitting this fix, @ygd58! The core idea was solid — we cherry-picked and improved your approach in commit ee40084, which addresses the flashing issue by routing CLI thinking through a proper prompt_toolkit widget (avoiding the raw spinner vs TUI conflict entirely). We also added spinner flush rate-limiting in e4adb67 on top of that. Since the fix is already on main (and issue #464 is closed), closing this PR. Appreciate you identifying the problem and putting together a fix! 🙏 |
… widget Cherry-picked and improved from PR NousResearch#470 (fixes NousResearch#464). Problem: On Ubuntu 24.04 with ghostty + tmux, the prompt input box border lines flash due to cursor blink and raw spinner terminal writes conflicting with prompt_toolkit's rendering. Changes: - cli.py: Add CursorShape.BLOCK to Application() to disable cursor blink - cli.py: Add thinking_callback + spinner_widget in TUI layout so thinking status displays as a proper prompt_toolkit widget instead of raw terminal writes that conflict with the TUI renderer - run_agent.py: Add thinking_callback parameter to AIAgent; when set, uses the callback instead of KawaiiSpinner for thinking display What was NOT changed (preserving existing behavior): - agent/display.py: Untouched. KawaiiSpinner _write() stdout capture, _animate() logic, and 0.12s frame interval all preserved. This protects subagent stdout redirection and keeps smooth animations for non-CLI contexts (gateway, batch runner). - Original emoji spinner types (brain/sparkle/pulse/moon/star) preserved for all non-CLI contexts. Fixes from original PR NousResearch#470: - CursorShape.STEADY_BLOCK -> CursorShape.BLOCK (STEADY_BLOCK doesn't exist in prompt_toolkit 3.0.52) - Removed duplicate self._spinner_text = '' line - Removed redundant nested if-checks Tested: 2706 tests pass, interactive CLI verified via tmux.
… widget Cherry-picked and improved from PR NousResearch#470 (fixes NousResearch#464). Problem: On Ubuntu 24.04 with ghostty + tmux, the prompt input box border lines flash due to cursor blink and raw spinner terminal writes conflicting with prompt_toolkit's rendering. Changes: - cli.py: Add CursorShape.BLOCK to Application() to disable cursor blink - cli.py: Add thinking_callback + spinner_widget in TUI layout so thinking status displays as a proper prompt_toolkit widget instead of raw terminal writes that conflict with the TUI renderer - run_agent.py: Add thinking_callback parameter to AIAgent; when set, uses the callback instead of KawaiiSpinner for thinking display What was NOT changed (preserving existing behavior): - agent/display.py: Untouched. KawaiiSpinner _write() stdout capture, _animate() logic, and 0.12s frame interval all preserved. This protects subagent stdout redirection and keeps smooth animations for non-CLI contexts (gateway, batch runner). - Original emoji spinner types (brain/sparkle/pulse/moon/star) preserved for all non-CLI contexts. Fixes from original PR NousResearch#470: - CursorShape.STEADY_BLOCK -> CursorShape.BLOCK (STEADY_BLOCK doesn't exist in prompt_toolkit 3.0.52) - Removed duplicate self._spinner_text = '' line - Removed redundant nested if-checks Tested: 2706 tests pass, interactive CLI verified via tmux.
… widget Cherry-picked and improved from PR NousResearch#470 (fixes NousResearch#464). Problem: On Ubuntu 24.04 with ghostty + tmux, the prompt input box border lines flash due to cursor blink and raw spinner terminal writes conflicting with prompt_toolkit's rendering. Changes: - cli.py: Add CursorShape.BLOCK to Application() to disable cursor blink - cli.py: Add thinking_callback + spinner_widget in TUI layout so thinking status displays as a proper prompt_toolkit widget instead of raw terminal writes that conflict with the TUI renderer - run_agent.py: Add thinking_callback parameter to AIAgent; when set, uses the callback instead of KawaiiSpinner for thinking display What was NOT changed (preserving existing behavior): - agent/display.py: Untouched. KawaiiSpinner _write() stdout capture, _animate() logic, and 0.12s frame interval all preserved. This protects subagent stdout redirection and keeps smooth animations for non-CLI contexts (gateway, batch runner). - Original emoji spinner types (brain/sparkle/pulse/moon/star) preserved for all non-CLI contexts. Fixes from original PR NousResearch#470: - CursorShape.STEADY_BLOCK -> CursorShape.BLOCK (STEADY_BLOCK doesn't exist in prompt_toolkit 3.0.52) - Removed duplicate self._spinner_text = '' line - Removed redundant nested if-checks Tested: 2706 tests pass, interactive CLI verified via tmux.
… widget Cherry-picked and improved from PR NousResearch#470 (fixes NousResearch#464). Problem: On Ubuntu 24.04 with ghostty + tmux, the prompt input box border lines flash due to cursor blink and raw spinner terminal writes conflicting with prompt_toolkit's rendering. Changes: - cli.py: Add CursorShape.BLOCK to Application() to disable cursor blink - cli.py: Add thinking_callback + spinner_widget in TUI layout so thinking status displays as a proper prompt_toolkit widget instead of raw terminal writes that conflict with the TUI renderer - run_agent.py: Add thinking_callback parameter to AIAgent; when set, uses the callback instead of KawaiiSpinner for thinking display What was NOT changed (preserving existing behavior): - agent/display.py: Untouched. KawaiiSpinner _write() stdout capture, _animate() logic, and 0.12s frame interval all preserved. This protects subagent stdout redirection and keeps smooth animations for non-CLI contexts (gateway, batch runner). - Original emoji spinner types (brain/sparkle/pulse/moon/star) preserved for all non-CLI contexts. Fixes from original PR NousResearch#470: - CursorShape.STEADY_BLOCK -> CursorShape.BLOCK (STEADY_BLOCK doesn't exist in prompt_toolkit 3.0.52) - Removed duplicate self._spinner_text = '' line - Removed redundant nested if-checks Tested: 2706 tests pass, interactive CLI verified via tmux.


Fixes #464
Problem
On Ubuntu 24.04 with ghostty + tmux, the prompt input box border lines
flash repeatedly due to two causes:
Changes
CursorShape.STEADY_BLOCKtoApplication()to disableblinking cursor
dotsspinner during thinking phase
0.12sto0.25sto reduce terminal redraw frequencyTested
Ubuntu 24.04, ghostty + tmux, local llama.cpp server