Skip to content

Add optional pagination to list_sessions #6314

Open

Description

@david-dev666

Problem / Motivation

list_sessions returns every other persisted session in one tool result. As conversations accumulate, an agent cannot request a bounded page of handles, even when it only needs to inspect a few sessions.

Proposed Solution

Add optional nonnegative offset and positive limit parameters. Paginate the existing handle order after excluding the current session. Keep the JSON array result and the current full-list behavior when the parameters are omitted.

Alternatives Considered

The agent can discard extra handles after reading the full result, but that still consumes context. Changing the default limit would also change existing behavior.

Related Component

Other

Additional Context

A focused implementation and documentation are ready. The related session tool and handle tests pass (29 tests), including page boundaries, current-session exclusion, and invalid input.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions