Skip to content

fix(output): stop pagination at max items - #43

Open
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/max-items-extra-advance
Open

fix(output): stop pagination at max items#43
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/max-items-extra-advance

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • check the remaining item limit before advancing a paged iterator
  • avoid fetching or consuming one extra item after --max-items is reached
  • cover the pager path with a regression test

Testing

  • go test ./pkg/cmd -run TestShowJSONIterator -count=1
  • go test ./internal/...

@fallintoplace
fallintoplace requested a review from a team as a code owner July 31, 2026 16:48

@jbeckwith-oai jbeckwith-oai 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.

Reviewed the complete pagination/output diff at d82a04e. No blocking findings. The short-circuit condition now checks the remaining item budget before advancing the iterator, preventing an N+1 item consumption or page fetch while preserving zero, positive, and unlimited limits. Targeted tests, race testing, internal package tests, build validation, formatting, and diff checks passed locally.

@markstuart-oai
markstuart-oai force-pushed the fix/max-items-extra-advance branch from d82a04e to a68dace Compare September 6, 2026 01:13
@markstuart-oai

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T01:30:59.068549Z a68dace Manual request
🔒 Security Review Completed 2026-09-06T01:32:10.818756Z a68dace Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: a68dace389

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: a68dace389

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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.

3 participants