You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bot-comment retry scan fails with "jq: Argument list too long" on PRs with many comments — undispositioned bot comments are never retried #2072
The bot-comment retry scan added in #2022 fails closed on PRs with many comments: jq is invoked with the whole comment list as a command-line argument and exits with Argument list too long, so the scan skips the PR and never retries its undispositioned bot comments.
pr-review run 37660413486 (workflow_dispatch, head 01aaf93) logged:
[bot-comment-retry] scripts/lib/bot-comment-retry.sh: line 230: /usr/bin/jq: Argument list too long
[bot-comment-retry] [warn] bot-comment retry: could not read PR 1953 comments in petry-projects/.github-private — skipping (fail closed)
The gate in the same run withheld approval because 4 PR issue comments lacked a verified disposition. The retry that exists to clear exactly that case never ran. On 2026-10-04 the same scan worked on this PR (it dispatched a retry for one CodeRabbit comment); the comment history has grown since.
Cause
scripts/lib/bot-comment-retry.sh (~L230) passes the fetched comments to jq via --argjson or an argument, which hits the OS argument-size limit (ARG_MAX) once the JSON is large.
Proposed fix
Feed the comment JSON to jq on stdin or from a file (jq --slurpfile / jq < file), never as an argument. Apply to every jq --argjson/--arg call in the retry library that carries comment bodies.
Acceptance criteria
The scan reads PRs with thousands of comments and several MB of comment text without error.
A fetch or parse failure still fails closed, with a distinct warning from the size case.
bats test with a synthetic large comment set (well over ARG_MAX).
Issue:#2072 — bot-comment retry scan fails with "jq: Argument list too long" on PRs with many comments
Scope
Stop bcr_fetch_pr_comments from passing accumulated comment JSON to jq as command-line arguments (--argjson); stream each page to a temp file and merge with jq -s reading the file, and emit a distinct stderr reason for each fail-closed path.
Implementation Checklist
scripts/lib/bot-comment-retry.sh: bcr_fetch_pr_comments appends each page's nodes array to a temp file and merges with jq -cs 'add' (no --argjson of comment data); temp file removed on every path
Same function: distinct [warn] on stderr for API failure / GraphQL errors / unparseable page / invalid pagination / merge failure (still returns 1, echoes nothing on stdout)
Audit other --arg/--argjson uses in the retry library and callers (dev-lead-retry.sh, dev-lead-intent.sh) — only L230 carries comment bodies
Tests to Write
tests/dev-lead/unit/test_bot_comment_retry.bats: synthetic multi-page response (thousands of comments, several MB — well over ARG_MAX) is read and returned in full
Fail-closed cases emit a distinct reason on stderr and nothing on stdout
The implementation for issue #2072 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
Review happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.
Activity
don-petry commentedon Oct 7, 2026
Dev-Lead Implementation Plan
Issue: #2072 — bot-comment retry scan fails with "jq: Argument list too long" on PRs with many comments
Scope
Stop
bcr_fetch_pr_commentsfrom passing accumulated comment JSON tojqas command-line arguments (--argjson); stream each page to a temp file and merge withjq -sreading the file, and emit a distinct stderr reason for each fail-closed path.Implementation Checklist
scripts/lib/bot-comment-retry.sh:bcr_fetch_pr_commentsappends each page'snodesarray to a temp file and merges withjq -cs 'add'(no--argjsonof comment data); temp file removed on every path[warn]on stderr for API failure / GraphQL errors / unparseable page / invalid pagination / merge failure (still returns 1, echoes nothing on stdout)--arg/--argjsonuses in the retry library and callers (dev-lead-retry.sh,dev-lead-intent.sh) — only L230 carries comment bodiesTests to Write
tests/dev-lead/unit/test_bot_comment_retry.bats: synthetic multi-page response (thousands of comments, several MB — well over ARG_MAX) is read and returned in fullTest Command
bats tests/dev-lead/unit/test_bot_comment_retry.bats tests/dev-lead/unit/test_intent_bot_comment_retry.batsdon-petry commentedon Oct 7, 2026
Dev-Lead: Implementation Complete — PR #2073
The implementation for issue #2072 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
42f2e0f6bde1ce02a24764772b390acc415556a5main: 2 file(s), +112/-16 linesReview happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.
fix(dev-lead): reject a non-advancing comment cursor and always clean…
feat: implement issue #2072 — bot-comment retry scan fails with "jq: …