Summary
Flagged by CodeRabbit on PR #39 (inline comment, scripts/gh-create-issue-context.py:87), declined as out-of-scope for that PR because the bug lives in pre-existing shared code, not anything #39 introduced.
run_gh_api(paginate=True) in scripts/_gh_common.py passes gh api --paginate and parses stdout with a single json.loads() call. gh api --paginate (without --slurp) emits one JSON value per page, concatenated — so any response spanning more than one page raises JSONDecodeError: Extra data.
CodeRabbit's proposed fix: use --slurp to wrap all pages into a single outer array, then flatten. Caveat: --slurp is mutually exclusive with --jq — any paginate=True call site that also passes jq= needs that jq filtering moved to post-processing.
Affected call sites
run_gh_api(paginate=True) is used identically (no --slurp) by:
scripts/gh-create-issue-context.py
scripts/gh-summary.py
scripts/gh-quick-wins.py
scripts/gh-refresh-issues.py
scripts/gh-release-status.py
All are exposed to this bug whenever a paginated query actually spans more than one page.
Suggested fix
- Add
--slurp in run_gh_api when paginate=True.
- Flatten the resulting array-of-page-arrays before returning.
- Audit call sites for
paginate=True combined with jq= and move that filtering to Python-side post-processing.
- Add a two-page regression test (this is what exposed the gap — CodeRabbit's repro used a JSON round-trip probe, not a live multi-page fetch).
🤖 Generated by Claude Code on behalf of @cbeaulieu-gt
Summary
Flagged by CodeRabbit on PR #39 (inline comment, scripts/gh-create-issue-context.py:87), declined as out-of-scope for that PR because the bug lives in pre-existing shared code, not anything #39 introduced.
run_gh_api(paginate=True)inscripts/_gh_common.pypassesgh api --paginateand parses stdout with a singlejson.loads()call.gh api --paginate(without--slurp) emits one JSON value per page, concatenated — so any response spanning more than one page raisesJSONDecodeError: Extra data.CodeRabbit's proposed fix: use
--slurpto wrap all pages into a single outer array, then flatten. Caveat:--slurpis mutually exclusive with--jq— anypaginate=Truecall site that also passesjq=needs thatjqfiltering moved to post-processing.Affected call sites
run_gh_api(paginate=True)is used identically (no--slurp) by:scripts/gh-create-issue-context.pyscripts/gh-summary.pyscripts/gh-quick-wins.pyscripts/gh-refresh-issues.pyscripts/gh-release-status.pyAll are exposed to this bug whenever a paginated query actually spans more than one page.
Suggested fix
--slurpinrun_gh_apiwhenpaginate=True.paginate=Truecombined withjq=and move that filtering to Python-side post-processing.🤖 Generated by Claude Code on behalf of @cbeaulieu-gt