Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

explore: auto-paginate queryEvents to support --limit > 100 #861

Closed

Description

@BYK

Context

The sentry explore command (added in #857) currently caps --limit at API_MAX_PER_PAGE (100) because the Sentry Events API silently caps per_page server-side and we don't yet auto-paginate. AGENTS.md long-term knowledge calls out this expectation:

When --limit exceeds API_MAX_PER_PAGE (100), list commands MUST transparently fetch multiple pages to fill the requested limit.

Other list commands (issue list via listIssuesAllPages) already do this. explore should match.

Ref: #857 (review) review feedback (subagent self-review pre-merge)

Proposal

Add auto-pagination to queryEvents in src/lib/api/discover.ts, similar to listIssuesAllPages:

  • Cap per_page server-side at Math.min(limit, API_MAX_PER_PAGE).
  • Loop fetching pages until results.length >= limit or the cursor is exhausted.
  • Bound by MAX_PAGINATION_PAGES for safety.
  • In the explore command, raise parseLimit cap from API_MAX_PER_PAGE back to LIST_MAX_LIMIT (1000).

Files

  • src/lib/api/discover.ts — add pagination loop
  • src/commands/explore.ts — raise parseLimit cap, update help text
  • test/lib/api/discover.test.ts — add tests for multi-page fetch

Activity

  1. self-assigned this
    on Apr 29, 2026
  2. added a commit that references this issue on Apr 29, 2026
    f950445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions