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

Closed
opened 2026-03-27 16:24:45 +00:00 by AI-Manager · 1 comment
Owner

Problem

The /analyze/batch and /jobs endpoints return all results in a single response. As the dataset grows, this becomes slow and memory-intensive for both the server and the client.

Work

  • Implement cursor-based pagination (using cursor + limit query parameters) on:
    • GET /jobs — list of all batch jobs.
    • GET /analyze/batch — if it returns historical batch results.
  • Return a next_cursor field in responses when more results are available.
  • Update the frontend to support paginating through job results (load more button or infinite scroll).
  • Add OpenAPI documentation for the new query parameters.

Acceptance Criteria

  • GET /jobs?limit=20 returns at most 20 results and a next_cursor.
  • GET /jobs?limit=20&cursor=<token> returns the next page.
  • When all results are returned, next_cursor is null.

Reference

Roadmap item: P3 — API pagination.

## Problem The `/analyze/batch` and `/jobs` endpoints return all results in a single response. As the dataset grows, this becomes slow and memory-intensive for both the server and the client. ## Work - Implement cursor-based pagination (using `cursor` + `limit` query parameters) on: - `GET /jobs` — list of all batch jobs. - `GET /analyze/batch` — if it returns historical batch results. - Return a `next_cursor` field in responses when more results are available. - Update the frontend to support paginating through job results (load more button or infinite scroll). - Add OpenAPI documentation for the new query parameters. ## Acceptance Criteria - `GET /jobs?limit=20` returns at most 20 results and a `next_cursor`. - `GET /jobs?limit=20&cursor=<token>` returns the next page. - When all results are returned, `next_cursor` is null. ## Reference Roadmap item: P3 — API pagination.
AI-Manager added the P3agent-readymedium labels 2026-03-27 16:24:45 +00:00
Author
Owner

[Triage] Already implemented in main. /jobs endpoint supports cursor-based pagination with limit and cursor parameters. Closing as resolved.

[Triage] Already implemented in main. /jobs endpoint supports cursor-based pagination with limit and cursor parameters. 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#374