You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Streaming LiveBlock taller than the live window is evicted and its later updates are lost #14
A streaming ILiveBlock that grows taller than the live window is lost partway through.
In ScrollbackModel.PrePaint (src/Dcli/Internal/Scrollback/ScrollbackModel.cs, around line 215), when the live rows exceed maxHeight (Rows − fixed region), objects are committed from the front of the live list until it fits. That includes a LiveBlock that hasn't been committed yet. Its rows so far go to native scrollback and it leaves the live list. Later calls to AppendText, SetContent or Commit on its handle then change a detached object, so they never show.
Seen in dmon: a 2,091-character model reply showed cut off after about one screen.
Expected
An uncommitted LiveBlock is never dropped. When it overflows, the live window shows its newest rows, or flushes its top rows to scrollback and keeps the rest live. Its later updates and Commit still land, with no rows lost or duplicated.
Repro
Headless terminal, 100×30.
BeginLive().
AppendText 10 short lines → LiveWindowRows is 1.
AppendText ~400 words → LiveWindowRows is 0.
AppendText("\nline 51") → LiveWindowRows is still 0, and the text never appears.
Also worth a look
AppendText renders \n as a space, so streamed text shows as one paragraph until SetContent replaces it. With the block evicted, that replacement never happens, so the reply stays flattened.
Downstream
dmon-core-next will bump dcli (currently 0.3.0-rc.0) and add a headless regression test once a release has the fix.
Fixed in dcli 0.4.0, now on nuget.org (dcli and dcli.testing), via #16.
What changed for consumers
An open ILiveBlock is never pushed into scrollback by overflow. If it's taller than the live window, the window shows its newest rows, and later AppendText / SetContent calls keep landing. Commit() sends the full final content to scrollback once, in order. The repro from this issue (100×30, 10 lines, ~400 words, then "\nline 51") is covered by a headless regression test.
Only the consumer commits. Several live blocks may be open at once, and dcli never commits one for you. An uncommitted block holds back everything appended after it from scrollback until it commits; nothing is lost. So call Commit() on every path, including errors and cancellation (e.g. in a finally).
BREAKING (behavioural):AppendText now treats \n and \r\n as line breaks, even when split across appends. A trailing \n adds no blank row. Streamed replies keep their paragraphs before SetContent.
An oversized ICollapsible expansion behind an open live block now waits for that block, so its lines don't land above it in scrollback.
For dmon-core-next: bump dcli to 0.4.0 and add the planned headless regression test. Also check that every block in Transcript._live is committed on error, restart and cancellation paths: with this fix, a block that's never committed delays scrollback rather than losing text.
Activity
Merge pull request #16 from daemonicai/change/fix-live-block-overflow
ThatRendle commentedon Dec 2, 2026
Fixed in dcli 0.4.0, now on nuget.org (
dclianddcli.testing), via #16.What changed for consumers
ILiveBlockis never pushed into scrollback by overflow. If it's taller than the live window, the window shows its newest rows, and laterAppendText/SetContentcalls keep landing.Commit()sends the full final content to scrollback once, in order. The repro from this issue (100×30, 10 lines, ~400 words, then"\nline 51") is covered by a headless regression test.Commit()on every path, including errors and cancellation (e.g. in afinally).AppendTextnow treats\nand\r\nas line breaks, even when split across appends. A trailing\nadds no blank row. Streamed replies keep their paragraphs beforeSetContent.ICollapsibleexpansion behind an open live block now waits for that block, so its lines don't land above it in scrollback.For dmon-core-next: bump
dclito0.4.0and add the planned headless regression test. Also check that every block inTranscript._liveis committed on error, restart and cancellation paths: with this fix, a block that's never committed delays scrollback rather than losing text.