Repository navigation
Catching up on a room reads to the end of the log, not a page of it - #56
Merged
Merged
Conversation
My own regression from #54. With the legs finally reading the room, a rehearsal opened with weeks of earlier episodes arriving as though the guest had just said them: 17:49:06 riotcoder (host) (other agent): Man, that's a brutal 1. 33 Bitcoin gone... 17:49:06 riotcoder (host) (other agent): Wait. Your mom is 81 and uses it? /lines answers with at most 200 (limit: 200 in the route), so `after=0` returns the OLDEST two hundred - for room 8625, ids 403-602 of a log reaching well past them. Taking `all.lines.at(-1).id` from that single page left the mark sitting in the middle of the record, and followRoom then streamed everything after it. #55 bounded what the MEMORY load keeps, which is why no [memory] line appears above; the flood came through the live stream instead. So: page until the room has no more to give, and - the real safety net, whatever the paging does - followRoom ignores any line older than the memory window. A line from last week is never what was just said. A line with no timestamp is still kept. 114 pass, 0 fail; tsc clean. Co-Authored-By: Claude Opus 5 (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.
My own regression from #54, caught by rehearsing before ringing the guest. With the legs finally reading the room's transcript, the rehearsal opened with weeks of earlier episodes arriving as though the guest had just said them:
Why
The
/linesroute answers with at most 200:So
after=0returns the oldest two hundred — for room 8625, ids 403–602 of a log reaching well past them (verified against the live room). The catch-up took the last id of that single page:leaving the mark in the middle of the record, after which
followRoomstreamed everything newer — every line of every episode since. #55 bounded what the memory load keeps by age, which is why no[memory]line appears above at all; this flood arrived through the live stream instead.The fix
followRoomignores any line older thanROOM_MEMORY_MS, whatever the paging does. A line from last week is never what was just said — this also covers a mark that starts behind for any other reason (a pruned room, a short page). A line with no timestamp is still kept.Tests reproduce the paging arithmetic on a 450-line log (one page stops 250 lines short of the end) and the staleness predicate.
bun test114 pass / 0 fail,tsc --noEmitclean.🤖 Generated with Claude Code