Skip to content

fix(messages): stop the channel timeline jumping back when agents or search read old messages - #1256

Merged
kalvinnchau merged 3 commits into
mainfrom
larry/window-read-bounds
Oct 16, 2026
Merged

kalvinnchau merged 3 commits into
mainfrom
larry/window-read-bounds

Conversation

@loganj

@loganj loganj commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖

Summary

  • Fixes the channel timeline "jumping back" while you sit in a channel. The reader is pushed up into older history, and the Jump to latest button shows "35 new messages", then "67", then "78". When you scroll down there is nothing new.
  • Cause: agents, search and previews read channel messages through your session (for example, a goose agent reading a thread root, or agent catch-up after a reconnect). Each read result was merged into the open channel's timeline, even a message from well before the loaded history. That old message showed at the top of the list with a gap below it. Each older history page then filled the gap in the middle of the list. The timeline only anchors the reader and ignores the count for rows added at the top, so a middle insert moved the view and was counted as new messages.
  • Now a channel timeline shows only messages from its loaded history and newer. An older message from a read waits until history paging reaches it, and then it shows in its correct place.

Details

  • The rule is in one place: the channel store builds the timeline rows from loaded pages, live traffic and read results. Message rows older than the oldest loaded page are left out while more history exists. Reactions, edits and deletions still apply to loaded rows, and messages newer than that limit (live or read) still show at once. With all history loaded, nothing is left out.
  • This started with the agent features of the last few days, which read through the owner's session: agent read tools (refactor(agents): separate the agent runner and its reads from the desktop app #961), goose context reads (feat(goose): add the goose agent type #1125) and catch-up after a reconnect (feat(agents): catch chat watches up on messages missed while offline #957).
  • Inbox previews: an out-of-range anchor is no longer put into the preview's timeline as a stray row. It opens in the thread reader as designed. fix(inbox): show each row's newest message #1212 (open) pages the preview back to the anchor instead, and this change does not conflict with it.
  • New store test: a read before the channel opens and a read while it is open do not add an old row; a newer read still lands; the page that reaches the old row shows it in order. The test fails on main at the first assertion.
  • Not changed: the timeline still detects "older rows added" from the first and last rows only. When the store keeps the list contiguous, that check is correct.

Also in this PR

One line in src/features/agents/launch-boundary.test.ts adds the missing effort field to the Goose fixture. Main fails typecheck without it since #1250 and #1185 landed together. #1257 and #1260 carry the same line, so the hunks merge cleanly in any order.

loganj and others added 2 commits October 16, 2026 12:15
…y out of its timeline

Agents, search and previews read channel messages through the session, and
the store merged every result into the open channel window. An old message
from such a read landed above the loaded history with a gap below it. Each
older page then filled that gap in the middle of the list, so the timeline
neither anchored the reader nor told the rows from new arrivals: the reader
jumped back and the Jump to latest button counted the page as new messages.

A window now shows rows only from its loaded history and newer. Rows from
before it wait for the page that reaches them.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
Main fails typecheck since #1250 made effort required and #1185 added
this fixture without it. Same one-line fix as in #1257 and #1260.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj marked this pull request as ready for review October 16, 2026 17:01
@loganj
loganj requested a review from a team as a code owner October 16, 2026 17:01
Comment thread src/features/relay/store.ts Outdated
…ast them

The history floor read the window cursor, but a reconnect catch-up moves
that cursor to the new head. When more than one page arrived during the
outage, every row the reader had loaded fell below the floor and
vanished. The window now keeps its own floor: the oldest point a page
read reached. It only falls while the window lives and resets when the
window's rows are cleared.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@kalvinnchau
kalvinnchau merged commit 1b4a7b4 into main Oct 16, 2026
59 of 61 checks passed
@kalvinnchau
kalvinnchau deleted the larry/window-read-bounds branch October 16, 2026 18:27
johnmatthewtennant added a commit that referenced this pull request Oct 16, 2026
…lation

* origin/main: (139 commits)
  feat(agents): let plugins read each agent's sessions (#1111)
  chore(deps): upgrade vitest to 5.0.4 (#1272)
  feat(plugins): reload folder plugins from the CLI (#1265)
  add channel shared sessions discovery and retrieval (#1254)
  polish Solo activity layout and fold previous steps (#1257)
  fix(agents): clarify model defaults and provider actions (#1177)
  fix(messages): stop the channel timeline jumping back when agents or search read old messages (#1256)
  Add Close other tabs to the tab menu (#1127)
  chore(deps): upgrade virtua to 0.53.5 and port its scroll patch (#1269)
  Auto-tag Berd drafts with a chosen default agent (#1139)
  test: delete styling, markup and call-count trivia tests (#1255)
  fix(hooks): preserve recovery ownership on lefthook 2.2.2 (#1174)
  fix(deps): upgrade vulnerable tls and editor dependencies (#1267)
  chore(terminal): upgrade xterm with compatible navigation (#1268)
  feat(goose): show goose and provider marks on agent cards (#1260)
  fix(agents): show native agent pictures in the Solo agent picker (#1258)
  test(agents): fix main typecheck — add effort to Goose fixture (#1262)
  fix(messages): reject unclaimed file and link drops app-wide (#1075)
  feat(channels): create and read system channels (#965)
  Refine message layout and bubble reading widths (#1218)
  ...
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.

2 participants