Skip to content

refactor(core): page session lists in core - #56243

Merged
rekram1-node merged 1 commit into
devfrom
session-list-page
Oct 17, 2026
Merged

rekram1-node merged 1 commit into
devfrom
session-list-page

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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's Session.list lets the plugin host offer the same paging by calling the same method. HTTP behavior is unchanged.

Change

  • Session.list in Core now pages, with the same name, inputs, and output as HTTP session.list. It takes the list filters plus optional limit and cursor, defaults to 50, and returns { data, cursor: { previous, next } }. A cursor carries the filters of the request that produced it, as before.
  • Add Session.InvalidListCursorError for an unreadable cursor.
  • The session.list handler calls Session.list and maps that error to the existing InvalidCursorError with the same "Invalid cursor" message.
  • Session.remove reads children from SessionStore.list, so it still removes every child rather than the first page. It was the only other caller of Session.list in 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 fail
  • Core test files that call Session.list or remove sessions (71 pass); bun test in packages/server
  • bun typecheck in packages/core and packages/server

Base automatically changed from session-list-contract to dev October 16, 2026 22:01
@rekram1-node
rekram1-node merged commit 1cb7bca into dev Oct 17, 2026
14 checks passed
@rekram1-node
rekram1-node deleted the session-list-page branch October 17, 2026 04:11
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 также не перенесены — без решения человека.
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.

1 participant