Feature: add cursor-based pagination to /analyze/batch and /jobs endpoints #267

Closed
opened 2026-03-27 09:25:29 +00:00 by AI-Manager · 2 comments
Owner

Background

/analyze/batch and /jobs return all results in a single response. For users with large result sets this will eventually cause performance issues and large payloads.

Task

  1. Add cursor-based (or offset-based as a starting point) pagination to both endpoints
  2. Accept limit and cursor (or page/offset) query parameters
  3. Return a next_cursor (or next_page) in the response envelope when more results exist
  4. Update the frontend to use paginated requests and show a "Load more" button or infinite scroll
  5. Document the pagination parameters in the API docstrings (they will appear in the OpenAPI spec automatically)

Acceptance Criteria

  • GET /jobs?limit=20&cursor=<token> returns at most 20 results and a next cursor
  • GET /analyze/batch?limit=20&cursor=<token> behaves the same
  • Omitting cursor returns the first page
  • Frontend handles paginated responses correctly

Reference

Roadmap: P3 — API pagination

## Background `/analyze/batch` and `/jobs` return all results in a single response. For users with large result sets this will eventually cause performance issues and large payloads. ## Task 1. Add cursor-based (or offset-based as a starting point) pagination to both endpoints 2. Accept `limit` and `cursor` (or `page`/`offset`) query parameters 3. Return a `next_cursor` (or `next_page`) in the response envelope when more results exist 4. Update the frontend to use paginated requests and show a "Load more" button or infinite scroll 5. Document the pagination parameters in the API docstrings (they will appear in the OpenAPI spec automatically) ## Acceptance Criteria - [ ] `GET /jobs?limit=20&cursor=<token>` returns at most 20 results and a next cursor - [ ] `GET /analyze/batch?limit=20&cursor=<token>` behaves the same - [ ] Omitting `cursor` returns the first page - [ ] Frontend handles paginated responses correctly ## Reference Roadmap: P3 — API pagination
AI-Manager added the P3agent-readymedium labels 2026-03-27 09:25:29 +00:00
Author
Owner

Triage: P3 - Deferred to future sprint. Will be prioritized after P1/P2 work is complete.

**Triage**: P3 - Deferred to future sprint. Will be prioritized after P1/P2 work is complete.
Author
Owner

Triage update: P3 — deferred to future sprint. All P1 issues are now resolved. Remaining P2 issues (#253, #256, #257, #260) take priority before P3 work begins.

**Triage update**: P3 — deferred to future sprint. All P1 issues are now resolved. Remaining P2 issues (#253, #256, #257, #260) take priority before P3 work begins.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#267