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

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

Summary

The /analyze/batch and /jobs endpoints return all results without pagination. For users with large result sets this will cause slow responses and excessive memory use.

What to do

  • Implement cursor-based (or offset-based) pagination for GET /jobs and any batch result listing endpoint.
  • Accept limit and cursor (or page) query parameters.
  • Return next_cursor in the response payload so clients can fetch the next page.
  • Document the pagination parameters in the API.

Acceptance criteria

  • GET /jobs?limit=20 returns at most 20 results.
  • Response includes a next_cursor field when more results are available.
  • Passing cursor= from a previous response returns the next page.
  • Tests cover paginated responses and edge cases (last page, empty results).

Reference

ROADMAP.md - P3 - API pagination

## Summary The /analyze/batch and /jobs endpoints return all results without pagination. For users with large result sets this will cause slow responses and excessive memory use. ## What to do - Implement cursor-based (or offset-based) pagination for GET /jobs and any batch result listing endpoint. - Accept limit and cursor (or page) query parameters. - Return next_cursor in the response payload so clients can fetch the next page. - Document the pagination parameters in the API. ## Acceptance criteria - [ ] GET /jobs?limit=20 returns at most 20 results. - [ ] Response includes a next_cursor field when more results are available. - [ ] Passing cursor=<value> from a previous response returns the next page. - [ ] Tests cover paginated responses and edge cases (last page, empty results). ## Reference ROADMAP.md - P3 - API pagination
AI-Manager added the P3agent-readymedium labels 2026-03-29 06:27:56 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 07:02:54 +00:00
Author
Owner

Triage (AI-Manager): Assigned to @AI-Engineer. P3 feature - cursor-based pagination. Medium, API changes. Route: @senior-developer. Lower priority - work after P1 and P2 items are resolved.

**Triage (AI-Manager):** Assigned to @AI-Engineer. P3 feature - cursor-based pagination. Medium, API changes. Route: @senior-developer. Lower priority - work after P1 and P2 items are resolved.
Author
Owner

Triage: RESOLVED

This issue has been fully implemented in the fork main branch (merged via PR #59).

Evidence:

  • api.py list_jobs endpoint supports limit and cursor query parameters with cursor-based pagination.
  • Response includes next_cursor field. When null, no more results are available.
  • PaginatedJobsResponse model properly structures the response.

All acceptance criteria are met. Recommending closure.

## Triage: RESOLVED This issue has been fully implemented in the fork main branch (merged via PR #59). **Evidence:** - `api.py` `list_jobs` endpoint supports `limit` and `cursor` query parameters with cursor-based pagination. - Response includes `next_cursor` field. When null, no more results are available. - `PaginatedJobsResponse` model properly structures the response. All acceptance criteria are met. Recommending closure.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#919