fix(output): stop pagination at max items - #43
Conversation
jbeckwith-oai
left a comment
There was a problem hiding this comment.
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.
d82a04e to
a68dace
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
## Summary When GitHub omits a fork PR from both the workflow-run association and the base repository's commit-to-PR endpoint, Castiron cannot resolve the PR and leaves the required budget statuses missing. Port the focused fix from openai/openai-python#3831: fall back to listing open PRs by the source run's fork owner and branch, then retain the existing exact-head, target, freshness, and ambiguity checks. Cover report computation, budget evaluation, and publication; update the reporter integrity digest. ## Validation - Both evaluator and status-publisher regressions reproduce on unpatched main. - Castiron reporter/budget suite: 53 tests, OK (1 optional compiler-contract test skipped), including JavaScript publishers, pagination, stale heads, wrong targets, and ambiguous matches. - Ruff and Pyright for `scripts/castiron`; `git diff --check`. - Patched lookup verified against openai#43 with read-only GitHub requests. The trusted handler runs from main. After merging, rerun affected Castiron custom-code workflows so the required statuses can be published.
saioai
left a comment
There was a problem hiding this comment.
looks good to me. checking the limit before iter.Next() prevents the extra advance, and the new test covers that case.
Castiron custom code✅ No new custom-code files detected. 5 mixed files remain; 0 existing customizations changed. Compared 5 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 34906582087 --repo openai/openai-cli \
--name castiron-custom-code-34906582087-1 --dir /tmp/castiron-custom-code-34906582087-1
git apply --stat /tmp/castiron-custom-code-34906582087-1/custom-code.patch
cat /tmp/castiron-custom-code-34906582087-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 4aa657cbc6a0db66ea3954e26bdb1133e4c5b9f6 2c24e518fcf176fdb19646ef18e96fb25b5c0fb4
python3 scripts/castiron/custom_code_report.py report \
--base 4aa657cbc6a0db66ea3954e26bdb1133e4c5b9f6 \
--head 2c24e518fcf176fdb19646ef18e96fb25b5c0fb4 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-2c24e518fcf1
cat /tmp/castiron-custom-code-2c24e518fcf1/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Summary
--max-itemsis reachedTesting
go test ./pkg/cmd -run TestShowJSONIterator -count=1go test ./internal/...