Skip to content

fix: keep short MarkdownStream updates fully visible - #5671

Open
Alphaxiaoteng wants to merge 1 commit into
Aider-AI:mainfrom
Alphaxiaoteng:fix/mdstream-negative-live-window
Open

fix: keep short MarkdownStream updates fully visible#5671
Alphaxiaoteng wants to merge 1 commit into
Aider-AI:mainfrom
Alphaxiaoteng:fix/mdstream-negative-live-window

Conversation

@Alphaxiaoteng

Copy link
Copy Markdown

Summary

  • Fixes BUG: MarkdownStream can drop leading lines when live output is shorter than live_window #5654: when rendered output is shorter than live_window, num_lines - live_window becomes negative and lines[num_lines:] keeps only a suffix (e.g. 4 lines with window 5 → only the last line).
  • Clamp with max(0, num_lines - live_window) so all early lines stay in the Rich live area until they are actually stable.
  • Add regressions for the short-window and longer-than-window cases.

Test plan

  • pytest tests/basic/test_mdstream_short_window.py -q → 2 passed
  • Short case (live_window=5, 4 lines): all four lines retained in Live
  • Longer case (live_window=6, 8 lines): first two printed above Live, last six retained

Made with Cursor

Clamp stable-line count to zero so a render shorter than live_window
does not become a negative slice and drop leading lines. Fixes Aider-AI#5654.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: MarkdownStream can drop leading lines when live output is shorter than live_window

2 participants