Repository navigation
Conversation
herdr's terminal stream draws a screen whole once and then only the cells that change. A client joining an attachment late gets the last 256 KiB of that stream, so once a working agent pushed the whole frame out, a tab coming back (a phone or iPad returning to a pane a desktop tab holds) got only the cells a spinner and a timer rewrote: the prompt, its rule and the status line stayed blank, and no later frame brought them back. ReplayBuffer now says whether its tail still holds the stream's start (whole) and the modes the whole stream leaves (state). A joiner whose replay is no longer whole is drawn from pane.read (ansi, as the mirror draws it), then everything the stream sent meanwhile, in order; those frames write cells in place, so one the read already shows draws the same again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… screen; assert the screen path in its test mirrorFrame hides the cursor while it draws, so a late joiner of a pane whose cursor was visible kept it hidden until the next frame that set it. The contract test now also checks the joiner got far less than the 256 KiB tail, so a fall back to the tail cannot pass it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e the changelog entry to a fragment Carrying #939 onto main: main now sizes a late joiner's first-ACK budget to its replay frame (OutputWindow.join). The screen joinFromScreen sends is that frame, so it gets the same budget. The CHANGELOG.md entry moves into changelog.d/.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
devswha
marked this pull request as draft
October 14, 2026 01:48
Owner
Author
|
Closing: not reproducible in day-to-day use, and the Integration tests check was failing. Can be reopened if the late-joiner blank-footer issue shows up. |
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.
Supersedes #939
Problem
A tab that attaches to a pane another client already holds gets only the attachment's replay: the last 256 KiB of the terminal stream. herdr draws a screen whole once and then sends only the cells that change, so once a busy pane pushes that first whole frame out of the tail, a late joiner never gets the rows nothing has rewritten since (the prompt and status line under a working agent). Reproduced on main today with two tabs: tab A showed the footer rows, the late tab B showed only the churning rows.
Change
This carries @Noobear's #939 onto current main; their two commits are kept as they wrote them, with @Noobear as author:
ReplayBuffer.wholesays whether the tail still holds the stream from its start;ReplayBuffer.state()gives the private modes and modifyOtherKeys level the whole stream leaves.pane.read(visible, ansi) the way the mirror draws a screen (mirrorFrame), led by that state and followed by the stream's own cursor mode. Everything the stream sends while the read is in flight is held for that joiner and sent after the screen, in order. If the read fails, the joiner gets the tail as before. A short stream and mirrored panes are unchanged.server/late-joiner.contract.test.tsand awhole/state()case inserver/output-window.test.ts.On top, in a separate commit:
OutputWindow.join(...)call, and the screen framejoinFromScreensends now gets the samejoinbudget, since it is that joiner's replay frame.changelog.d/late-joiner-busy-pane-screen.md.Validation
Run in the carry worktree on this branch:
bun run typecheck: pass.HERDR_TEST_MODE=unit bun test ./server/output-window.test.ts ./src/conventions.test.ts ./scripts/conventions.test.ts ./server/conventions.test.ts ./scripts/changelog-fold.test.ts: 55 pass, 0 fail.bun run check run bun test --timeout 15000 ./server/late-joiner.contract.test.ts(isolated test herdr): 1 pass, 0 fail.Not run: the full unit suite, the other contract tests (including
server/output.contract.test.tsandserver/attach-held.contract.test.ts), browser scripts, and a hands-on two-tab browser check on this branch.