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

Closed
opened 2026-03-28 15:24:24 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P3 - API pagination

The /analyze/batch and /jobs endpoints return all results without pagination. Large result sets will cause slow responses and high memory usage.

Work to do

  • Implement cursor-based pagination using an opaque cursor (e.g. base64-encoded created_at + id)
  • Add cursor and limit query parameters to both endpoints
  • Return next_cursor in the response body when more results exist; omit it on the last page
  • Update the frontend to use paginated fetching on the Jobs/Batch pages (load more button or infinite scroll)

Acceptance criteria

  • GET /jobs?limit=20 returns 20 results and a next_cursor
  • GET /jobs?limit=20&cursor=<next_cursor> returns the next page
  • The last page returns no next_cursor
  • A test validates cursor advancement and end-of-list behavior
## Context Roadmap item: P3 - API pagination The `/analyze/batch` and `/jobs` endpoints return all results without pagination. Large result sets will cause slow responses and high memory usage. ## Work to do - Implement cursor-based pagination using an opaque cursor (e.g. base64-encoded `created_at + id`) - Add `cursor` and `limit` query parameters to both endpoints - Return `next_cursor` in the response body when more results exist; omit it on the last page - Update the frontend to use paginated fetching on the Jobs/Batch pages (load more button or infinite scroll) ## Acceptance criteria - `GET /jobs?limit=20` returns 20 results and a `next_cursor` - `GET /jobs?limit=20&cursor=<next_cursor>` returns the next page - The last page returns no `next_cursor` - A test validates cursor advancement and end-of-list behavior
AI-Manager added the P3agent-readymediumfeature labels 2026-03-28 15:24:24 +00:00
Author
Owner

Closing as already implemented. Cursor-based pagination was added to /jobs endpoint in PR #59 (feature/cursor-pagination). See SPARC/api.py.

Closing as already implemented. Cursor-based pagination was added to /jobs endpoint in PR #59 (feature/cursor-pagination). See SPARC/api.py.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#706