Repository navigation
fix: render older session history when an event page splits a turn - #1212
Merged
harshil-2096 merged 2 commits intoOct 29, 2026
Merged
harshil-2096 merged 2 commits into
harshil-2096 merged 2 commits into
Conversation
Hold the leading events of a turn whose turn.created is on an older page and re-join them with that page on scroll-up, instead of discarding them. Also stop the pre-getTurn progress paint from exposing pagination, so a scroll-up during load is not overwritten by the final snapshot. Fixes AGE-2666 Co-authored-by: Cursor <cursoragent@cursor.com>
govindavashishtha
requested review from
qaifi-tf and
sayan-truefoundry
as code owners
October 28, 2026 19:11
🦋 Changeset detectedLatest commit: 1d90f28 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
govindavashishtha
requested review from
kumarsks619,
sajal-truefoundry and
vinit-truefoundry
as code owners
October 28, 2026 19:11
harshil-2096
approved these changes
Oct 29, 2026
harshil-2096
deleted the
govinda/age-2666-older-messages-in-session-not-login-in-chat
branch
October 29, 2026 03:57
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.
Summary
On
/sessions/:id, scrolling up fetched the older events page but never rendered it. Only the newest 100 events showed.The events API pages by event count, so a page often ends in the middle of a turn. The newest page then starts with the turn's tail (including
turn.done), and itsturn.createdis on the older page. The loader discarded that tail. When the older page arrived it hadturn.createdbut noturn.done, so the turn was never committed. The Sessions browser view wasn't affected because it drains every page before rendering.Fixes AGE-2666
Changes
SessionHistoryPaginationgains an optionalpendingItemsAsc. It holds the oldest turn's events whoseturn.createdis still on an older page.fetchSessionEventsWindowputs the held events in front of the next older page, so the split turn is rebuilt whole. It returns the newly cut-off events instead of dropping them. Held events are discarded once there is no older history.hasOlder: falseand turned off scroll-up for good.getTurnprogress paint no longer publisheshistoryPagination. Before, a scroll-up during that window was overwritten by the finalsetSnapshot.toHistoryPaginationhelper.How was this tested?
packages/assistant-ui-runtime/test/convertTurnMessages.test.ts:listEventscall, then each scroll-up adds the split turn and then the oldest turn, with text in orderpnpm typecheckandpnpm test(263 tests) inpackages/assistant-ui-runtimepnpm exec eslint --max-warnings=0and Prettier on the changed filesChecklist
pnpm test,pnpm typecheck, lint and format pass forpackages/assistant-ui-runtime(rootpnpm buildnot run)packages/trueforge-sdk,python/trueforge_sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changed (not needed)Made with Cursor
Note
Medium Risk
Changes paginated session history assembly used on session chat reload and scroll-up; behavior is localized to assistant-ui-runtime but affects what messages users see when loading older turns.
Reviewed by Cursor Bugbot for commit 589335f. Bugbot is set up for automated code reviews on this repo. Configure here.