Repository navigation
refactor(core): page session lists in core - #56243
Merged
Merged
Conversation
rekram1-node
force-pushed
the
session-list-page
branch
from
October 16, 2026 22:02
6e73361 to
619b733
Compare
This was referenced Oct 16, 2026
rekram1-node
force-pushed
the
session-list-page
branch
from
October 17, 2026 03:56
619b733 to
2351afa
Compare
8 of 10 tasks
kobzevvv
added a commit
to gpt-mem/opencode-mem
that referenced
this pull request
Oct 20, 2026
chore(port): v2.1.0 upstream — 25 из 26 PORT-коммитов перенесены cherry-pick -x Один коммит (anomalyco#56243, постраничный список сессий) не перенесён: конфликт с нашей схемой пагинации (ListCursor/ListFilter из anomalyco#56205 — ASK, ждёт решения). 25 пунктов ASK также не перенесены — без решения человека.
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.
Why
Paging for
session.list(cursor parsing, the default limit of 50, and building the previous/next cursors) lived in the server handler, so only HTTP clients could use it. Moving it into Core'sSession.listlets the plugin host offer the same paging by calling the same method. HTTP behavior is unchanged.Change
Session.listin Core now pages, with the same name, inputs, and output as HTTPsession.list. It takes the list filters plus optionallimitandcursor, defaults to 50, and returns{ data, cursor: { previous, next } }. A cursor carries the filters of the request that produced it, as before.Session.InvalidListCursorErrorfor an unreadable cursor.session.listhandler callsSession.listand maps that error to the existingInvalidCursorErrorwith the same "Invalid cursor" message.Session.removereads children fromSessionStore.list, so it still removes every child rather than the first page. It was the only other caller ofSession.listin Core source.Validation
packages/core/test/session-list.test.ts: filtered paging in both directions matches the store's unpaged results, the default limit is 50, and invalid cursors failSession.listor remove sessions (71 pass);bun testinpackages/serverbun typecheckinpackages/coreandpackages/server