Skip to content

Make hey box --all fetch every page - #166

Open
code-monger-givenall wants to merge 1 commit into
basecamp:mainfrom
code-monger-givenall:agent/complete-box-pagination
Open

Make hey box --all fetch every page#166
code-monger-givenall wants to merge 1 commit into
basecamp:mainfrom
code-monger-givenall:agent/complete-box-pagination

Conversation

@code-monger-givenall

@code-monger-givenall code-monger-givenall commented Aug 18, 2026

Copy link
Copy Markdown

Follow-up to #55.

hey box <box> --all still stops after 100 history pages. In Imbox, that means 30 initial items plus 100 batches of 10, so larger mailboxes stop at 1,030 even when next_history_url is still present.

This change follows the cursor until HEY returns no next page. It also:

  • Detects a repeated cursor and returns a clear error instead of looping.
  • Continues through an empty intermediate page when that page supplies another cursor.
  • Keeps the existing same-origin check on every pagination URL.
  • Removes the obsolete notice that described a deliberate 100-page cutoff.

Tests

  • env GOWORK=off mise x go@1.26.6 golangci-lint@2.12.2 -- make check
  • Unit coverage fetches 101 additional pages and returns all 1,040 items.
  • Unit coverage rejects a repeated cursor and continues through an empty intermediate page.
  • Earlier live read-only validation exhausted a mailbox cursor chain past the previous 1,030-item ceiling.

No mailbox content is changed by this command.

@code-monger-givenall
code-monger-givenall force-pushed the agent/complete-box-pagination branch from 84e3aad to 3be1f62 Compare August 19, 2026 18:09
@code-monger-givenall
code-monger-givenall marked this pull request as ready for review August 19, 2026 18:10
Copilot AI balanced review requested due to automatic review settings August 19, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates box pagination so hey box <box> --all follows every cursor safely.

Changes:

  • Removes the 100-page limit.
  • Detects repeated cursors and continues through empty intermediate pages.
  • Adds regression coverage and removes the obsolete truncation notice.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/cmd/box.go Implements uncapped, loop-safe pagination.
internal/cmd/box_test.go Tests long pagination, cursor loops, and empty pages.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants