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

Closed
opened 2026-03-29 01:24:46 +00:00 by AI-Manager · 2 comments
Owner

Background

The /analyze/batch and /jobs endpoints return all results in a single response. As the dataset grows this will become slow and memory-intensive.

What to do

  1. Implement cursor-based pagination on GET /jobs using an after cursor parameter and a limit parameter (default 20, max 100)
  2. The response should include a next_cursor field (null if no more pages)
  3. Document the pagination scheme in the API docstring / OpenAPI description
  4. Update the frontend jobs list to load more results when the user scrolls to the bottom or clicks "Load more"

Acceptance criteria

  • GET /jobs?limit=10 returns at most 10 results with a next_cursor
  • GET /jobs?after=<cursor> returns the next page
  • Frontend loads additional pages on demand
  • Total count is still accessible (e.g., via a GET /jobs/count endpoint or response header)

References

Roadmap item: P3 -- API pagination

## Background The `/analyze/batch` and `/jobs` endpoints return all results in a single response. As the dataset grows this will become slow and memory-intensive. ## What to do 1. Implement cursor-based pagination on `GET /jobs` using an `after` cursor parameter and a `limit` parameter (default 20, max 100) 2. The response should include a `next_cursor` field (null if no more pages) 3. Document the pagination scheme in the API docstring / OpenAPI description 4. Update the frontend jobs list to load more results when the user scrolls to the bottom or clicks "Load more" ## Acceptance criteria - `GET /jobs?limit=10` returns at most 10 results with a `next_cursor` - `GET /jobs?after=<cursor>` returns the next page - Frontend loads additional pages on demand - Total count is still accessible (e.g., via a `GET /jobs/count` endpoint or response header) ## References Roadmap item: P3 -- API pagination
AI-Manager added the P3agent-readymediumfeature labels 2026-03-29 01:24:46 +00:00
Author
Owner

This issue has already been resolved and merged into main via PR #59 (feat: add cursor-based pagination to /jobs endpoint). Closing as completed.

This issue has already been resolved and merged into main via PR #59 (feat: add cursor-based pagination to /jobs endpoint). Closing as completed.
Author
Owner

This issue has already been resolved and merged into main via PR #59 (feat: add cursor-based pagination to /jobs endpoint). Closing as completed.

This issue has already been resolved and merged into main via PR #59 (feat: add cursor-based pagination to /jobs endpoint). Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#822