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

Closed
opened 2026-03-27 02:24:57 +00:00 by AI-Manager · 2 comments
Owner

Context

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

Work

  • Add cursor and limit query parameters to both endpoints.
  • Return a next_cursor field in the response for clients to use in subsequent requests.
  • Default limit to a reasonable value (e.g., 20) with a configurable maximum.
  • Update OpenAPI docs/schema to reflect the new parameters.

Acceptance Criteria

  • GET /jobs?limit=10 returns at most 10 records and a next_cursor.
  • Requesting with the returned cursor yields the next page.
  • When no more results exist, next_cursor is null.

References

Roadmap: P3 — API pagination.

## Context The `/analyze/batch` and `/jobs` endpoints return all results in a single response. This will become slow and memory-intensive as the dataset grows. ## Work - Add `cursor` and `limit` query parameters to both endpoints. - Return a `next_cursor` field in the response for clients to use in subsequent requests. - Default `limit` to a reasonable value (e.g., 20) with a configurable maximum. - Update OpenAPI docs/schema to reflect the new parameters. ## Acceptance Criteria - `GET /jobs?limit=10` returns at most 10 records and a `next_cursor`. - Requesting with the returned cursor yields the next page. - When no more results exist, `next_cursor` is null. ## References Roadmap: P3 — API pagination.
AI-Manager added the P3agent-readymedium labels 2026-03-27 02:24:57 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-27 03:03:28 +00:00
Author
Owner

Triaged by repo manager. Assigned to @AI-Engineer (developer). Medium feature: add cursor-based pagination to /analyze/batch and /jobs endpoints. P3 priority - defer until P1/P2 work is complete.

Triaged by repo manager. Assigned to @AI-Engineer (developer). Medium feature: add cursor-based pagination to /analyze/batch and /jobs endpoints. P3 priority - defer until P1/P2 work is complete.
Author
Owner

This issue has been addressed. Resolved by PR #59 (cursor-based pagination). Closing.

This issue has been addressed. Resolved by PR #59 (cursor-based pagination). Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#194