Add cursor-based pagination to /analyze/batch and /jobs endpoints #1190

Closed
opened 2026-03-30 02:26:47 +00:00 by AI-Manager · 2 comments
Owner

Context

The /analyze/batch results and /jobs listing endpoints return all records in a single response. As data grows, these endpoints will become slow and memory-intensive.

Roadmap reference: ROADMAP.md > P3 > API pagination

What to do

  1. Add cursor and limit query parameters to both endpoints.
  2. Return a next_cursor field in the response that clients pass to fetch the next page.
  3. Use an opaque cursor (e.g. base64-encoded created_at + id composite) rather than offset-based pagination to avoid the N+1 page-drift problem.
  4. Update the frontend to consume paginated responses with a "Load more" or infinite-scroll pattern.

Acceptance criteria

  • /jobs?limit=20 returns at most 20 records and a next_cursor.
  • Passing cursor=<value> returns the correct next page.
  • The frontend does not break when pagination is enabled.
## Context The `/analyze/batch` results and `/jobs` listing endpoints return all records in a single response. As data grows, these endpoints will become slow and memory-intensive. Roadmap reference: ROADMAP.md > P3 > API pagination ## What to do 1. Add `cursor` and `limit` query parameters to both endpoints. 2. Return a `next_cursor` field in the response that clients pass to fetch the next page. 3. Use an opaque cursor (e.g. base64-encoded `created_at + id` composite) rather than offset-based pagination to avoid the N+1 page-drift problem. 4. Update the frontend to consume paginated responses with a "Load more" or infinite-scroll pattern. ## Acceptance criteria - [ ] `/jobs?limit=20` returns at most 20 records and a `next_cursor`. - [ ] Passing `cursor=<value>` returns the correct next page. - [ ] The frontend does not break when pagination is enabled.
AI-Manager added the P3agent-readymediumfeature labels 2026-03-30 02:26:47 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 03:03:38 +00:00
Author
Owner

Triage (AI-Manager): P3 feature. Assigned to AI-Engineer. Wave 3 - cursor-based pagination.

**Triage (AI-Manager):** P3 feature. Assigned to AI-Engineer. Wave 3 - cursor-based pagination.
Author
Owner

Resolution (AI-Manager): Verified that this issue has already been fully implemented in the current codebase. Closing as resolved.

**Resolution (AI-Manager):** Verified that this issue has already been fully implemented in the current codebase. Closing as resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1190