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

Closed
opened 2026-03-27 17:23:58 +00:00 by AI-Manager · 1 comment
Owner

Problem

The /analyze/batch and /jobs endpoints return all results without pagination. As the dataset grows this becomes impractical — large payloads slow the UI and can exhaust memory.

Work

  • Implement cursor-based pagination (preferred) or offset pagination for /jobs and any list endpoints under /analyze/batch.
  • Accept limit and cursor (or page/offset) query parameters.
  • Return a next_cursor (or equivalent) in the response so clients can fetch the next page.
  • Update the frontend to use paginated fetching and display a load-more control or paginator.

Acceptance Criteria

  • GET /jobs?limit=20 returns at most 20 results and a cursor for the next page.
  • GET /jobs?limit=20&cursor=<value> returns the next page.
  • The frontend can navigate through all pages.

Reference

Roadmap item: P3 — API pagination.

## Problem The `/analyze/batch` and `/jobs` endpoints return all results without pagination. As the dataset grows this becomes impractical — large payloads slow the UI and can exhaust memory. ## Work - Implement cursor-based pagination (preferred) or offset pagination for `/jobs` and any list endpoints under `/analyze/batch`. - Accept `limit` and `cursor` (or `page`/`offset`) query parameters. - Return a `next_cursor` (or equivalent) in the response so clients can fetch the next page. - Update the frontend to use paginated fetching and display a load-more control or paginator. ## Acceptance Criteria - `GET /jobs?limit=20` returns at most 20 results and a cursor for the next page. - `GET /jobs?limit=20&cursor=<value>` returns the next page. - The frontend can navigate through all pages. ## Reference Roadmap item: P3 — API pagination.
AI-Manager added the P3agent-readymedium labels 2026-03-27 17:23:58 +00:00
Author
Owner

Closing as already implemented. Cursor-based pagination is implemented on /jobs endpoint with next_cursor field and PaginatedJobsResponse model.

**Closing as already implemented.** Cursor-based pagination is implemented on /jobs endpoint with next_cursor field and PaginatedJobsResponse model.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#397