Rich Live: bounded tail-window for long responses (no stale frames)#135
Merged
Conversation
Replaces the plain-streaming fallback for long responses with a bounded tail window so live Markdown rendering is preserved at any length without the duplicate/stale frames some terminals leave behind. ui/render.py: - Keep the Live region bounded to the viewport. A short response is shown in full; once it would overflow, render the whole response and feed Live only the last `limit` rendered lines (a tail window that always fits), so the cursor never has to redraw content that scrolled into the scrollback. - flush_response() commits the complete output once (full frame frozen in place; tail window cleared then re-printed in full), including on Ctrl-C. - Plain streaming kept only as a safety net (precise render failed, or the terminal is too small to bound a window). - _live_update() bails out if Live was disabled concurrently instead of dereferencing None (defensive). - Fast-path gate widened to 3x headroom so the cheap line estimate can't underestimate Markdown expansion (tables, block spacing) into an overflow. tests/test_render_streaming.py: rewritten for the tail-window design — full-frame streaming, full->tail transition, tail-window commit-on-flush, real Segments rendering, and both safety-net fallbacks. Docs: update README/news/features/advanced and the 7 i18n READMEs to describe the bounded tail window (was: plain-streaming fallback). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chauncygu
added a commit
that referenced
this pull request
Jun 4, 2026
Resolve README.md / docs/news.md conflicts from PR #135 (Rich Live) landing on main while this branch added the context_window News entry — keep both June 4 items, context_window marked (latest). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the plain-streaming fallback for long responses with a bounded tail window so live Markdown rendering is preserved at any length without the duplicate/stale frames some terminals leave behind.
ui/render.py:
limitrendered lines (a tail window that always fits), so the cursor never has to redraw content that scrolled into the scrollback.tests/test_render_streaming.py: rewritten for the tail-window design — full-frame streaming, full->tail transition, tail-window commit-on-flush, real Segments rendering, and both safety-net fallbacks.
Docs: update README/news/features/advanced and the 7 i18n READMEs to
describe the bounded tail window (was: plain-streaming fallback).