Skip to content

AHP listSessions ignores limit and cursor pagination parameters #329619

Open

Description

Summary

The VS Code AHP server accepts the paginated listSessions request shape, but ignores both limit and cursor and returns the complete session catalogue without a nextCursor.

I reproduced this through the local AHP endpoint:

{ "channel": "ahp-root://", "limit": 5 }

The response contained 188 items.

Code pointers

The protocol documents listSessions as incrementally pageable, including an example request with limit and a response with nextCursor:

The server handler discards the typed request params, calls the unpaged service, maps every session, and returns only { items }:

The existing handler tests cover field mapping, but every listSessions request omits pagination inputs; there is no limit/cursor coverage:

Expected

  • limit: 5 returns at most five items.
  • If more items exist, the result includes an opaque nextCursor.
  • Passing that cursor returns the next page.
  • Unknown cursors are rejected as invalid parameters, as documented.
  • Pages are ordered most-recently-modified first.

At minimum, paging in ProtocolServerHandler would bound the wire response. To avoid enumerating the full provider catalogue as well, pagination would need to flow through IAgentService.listSessions() and its providers.

Related

Activity

  1. connor4312 commented on Aug 7, 2026

    @connor4312
    Member

    The SDK does not support limiting the number of sessions we get back currently. So a limit here would just reduce wire traffic and the number of sessions we need to enrich from database stores. For my machine where I have lots of sessions, the list is 500ms to load. But being able to load like the first 10 quickly would be cool and then async-load the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions