Problem
RichUI re-renders the streaming Markdown every 80 new characters
(_TRUNCATE_STEP = 80) under rich.live.Live. Long model responses cause
hundreds of full-screen re-renders, which is CPU-heavy and can visibly lag on
slower terminals (and is brutal for the vhs demo recordings).
Proposed approach
- Benchmark re-render cost; consider: larger/adaptive step, rendering the
final block only on stream end, or throttling to N fps.
- Keep the "current partial output visible while streaming" behavior.
Where to look
gcode/ui.py:20 (_TRUNCATE_STEP), :132 (the Live refresh handler),
:164-191 (assistant_start/token/assistant_end).
Acceptance criteria
- A long model response streams with a measurable reduction in re-renders/Live updates.
- No visual regression in partial-token display.
Difficulty
Medium.
Problem
RichUIre-renders the streaming Markdown every 80 new characters(
_TRUNCATE_STEP = 80) underrich.live.Live. Long model responses causehundreds of full-screen re-renders, which is CPU-heavy and can visibly lag on
slower terminals (and is brutal for the vhs demo recordings).
Proposed approach
final block only on stream end, or throttling to N fps.
Where to look
gcode/ui.py:20(_TRUNCATE_STEP),:132(theLiverefresh handler),:164-191(assistant_start/token/assistant_end).Acceptance criteria
Difficulty
Medium.