You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: add cursor/offset pagination to GET /session/:id/message #20111
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
GET /session/:id/message only supports a limit query parameter. There is no way to page backwards through history — you can fetch the last N messages, but you cannot fetch messages before a given message ID or offset.
For clients that want to show a paginated conversation view (e.g. load the last 10 messages on open, then let the user load earlier history), this means the only option is to fetch everything or accept a fixed truncation.
Long sessions with heavy tool use can produce very large payloads — easily hundreds of MB for a single session fetch. Without pagination, clients are forced to either transfer all of it or show incomplete history with no way to load more in a controlled way.
Proposed solution:
Add a before cursor parameter (message ID) to the endpoint:
GET /session/:id/message?limit=20&before=<messageID>
This would return the 20 messages immediately preceding <messageID>, enabling incremental backwards pagination.
A before cursor is preferable over a simple integer offset since message counts can change (e.g. after compaction), but either would be a meaningful improvement over the current state.
changed the title [-]feat: add cursor/offset pagination to GET /session/:id/message[/-][+][FEATURE] add cursor/offset pagination to GET /session/:id/message[/+]on Mar 30, 2026
changed the title [-][FEATURE] add cursor/offset pagination to GET /session/:id/message[/-][+][FEATURE]: add cursor/offset pagination to GET /session/:id/message[/+]on Mar 30, 2026
Activity
[-]feat: add cursor/offset pagination to GET /session/:id/message[/-][+][FEATURE] add cursor/offset pagination to GET /session/:id/message[/+][-][FEATURE] add cursor/offset pagination to GET /session/:id/message[/-][+][FEATURE]: add cursor/offset pagination to GET /session/:id/message[/+]github-actions commentedon Mar 30, 2026
Thanks for updating the issue! It now meets the contributing guidelines. We appreciate the clear description of the problem and the proposed solution.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.