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
dev-lead fix-reviews reads reviewThreads(first:50) with no pagination — open threads past the first 50 are invisible, so the pass does nothing #2056
scripts/dev-lead-fix-reviews.sh reads a PR's review threads with reviewThreads(first:50) and no pagination, then filters to unresolved ones. On a PR with more than 50 threads, any open thread beyond the first 50 is invisible to the pass: OPEN_THREADS_JSON comes out empty and dev-lead concludes there is nothing to address.
The PR has 66 review threads, 65 resolved and 1 open (Codex P1, scripts/canary_report.sh:214, posted 02:13Z).
A fix-reviews pass dispatched at 05:21Z (dev-lead-reviews-retry, intent_type=fix-reviews, run 37179647099) logged: "OPEN_THREADS_JSON is empty, so there was nothing to address or reply to", then "No changes to commit", "Addressed 0 threads".
The thread is real and unresolved. GraphQL with a larger window returns it: isResolved:false, isOutdated:false, line:214, author chatgpt-codex-connector (Bot).
A plain PR comment asking dev-lead to take the thread was skipped as reason=self-comment (it was posted from the owner account), so there is no other route to it.
Resolved threads sort first, so the longer a PR lives, the more likely its newest open thread falls past the window. This is one cause of the "bot review threads never get a reply" pattern in #2046.
Locations
Both call sites use the same query:
scripts/dev-lead-fix-reviews.sh (~L2658, the fix-reviews / bot-comment branch)
scripts/dev-lead-fix-reviews.sh (~L2870, the human-pr / review-changes branch)
Proposed fix
Paginate reviewThreads with pageInfo { hasNextPage endCursor } until exhausted (the repo already has cursor-pagination helpers elsewhere, e.g. the outdated-thread scrub near L581), or fetch only unresolved threads. Fail closed if a page fetch errors, so a transient failure never looks like "nothing to do".
Acceptance criteria
A PR with more than 50 threads, where the only open thread is past the first 50, is seen by fix-reviews.
Both call sites share one paginated helper.
A failed page fetch is treated as an error, not as an empty list.
bats coverage with a fixture of more than 50 threads (page boundary at 50 and 100).
Issue:#2056 — dev-lead fix-reviews reads reviewThreads(first:50) with no pagination
Scope
Replace both unpaginated reviewThreads(first:50) reads in scripts/dev-lead-fix-reviews.sh with one shared cursor-paginated, fail-closed helper.
Implementation Checklist
New scripts/lib/open-review-threads.sh exposing ort_fetch_open_threads <owner/repo> <pr>: paginates reviewThreads(first:N, after:$cursor) with pageInfo{hasNextPage endCursor} until exhausted, emits a JSON array of unresolved threads (same node shape as today). Returns non-zero (no stdout) when any page fetch fails, returns GraphQL errors, lacks the reviewThreads.nodes array, or claims hasNextPage without a cursor.
scripts/dev-lead-fix-reviews.sh: source the lib; fix-reviews and human-pr|review-changes call the helper; on failure log ::error:: and exit 1 instead of passing on an empty list.
Tests to Write
tests/dev-lead/unit/test_open_review_threads.bats (cursor-aware gh stub serving a fixture): 51 threads with the only open one at Compliance: unpinned-actions-pr-review.yml #51 (page size 50); 101 threads with the open one at chore: remove frameworks directory #101 (page size 100); boundaries at exactly 50/100; failure on page 2 → non-zero + no output; GraphQL errors → non-zero; missing nodes → non-zero; hasNextPage w/o cursor → non-zero.
tests/dev-lead/unit/test_fix_reviews.bats: both call sites use the helper (no reviewThreads(first:50) left); a failed thread fetch makes fix-reviews / review-changes exit non-zero instead of running on an empty list.
Dev-Lead: Progress (in progress — not yet durable)
Provisional. Nothing is pushed yet; the automation posts the authoritative
completion record (with PR number + head SHA) after the push. Treat the notes
below as intent, not delivered results.
Plan Execution (intended)
New shared helper ort_fetch_open_threads paginates reviewThreads (100/page, pageInfo{hasNextPage endCursor}) and fails closed.
Both OPEN_THREADS_JSON call sites (fix-reviews, human-pr|review-changes) now use it; a failed read logs ::error:: and exits 1 before the engine runs.
Files touched (this workspace, not yet pushed)
scripts/lib/open-review-threads.sh (new): paginated, fail-closed open-thread fetch. Treats a failed gh call, a GraphQL errors payload, a missing nodes array, non-JSON, or hasNextPage with no cursor as an error.
scripts/dev-lead-fix-reviews.sh: sources the lib and replaces both reviewThreads(first:50) queries.
Behaviour change: a thread-fetch failure now aborts the pass (exit 1) where it used to run on [], as the issue asks.
Some unrelated bats files (engine fallback/chain, batch fallback, review-one-pr claim/force-re-review, fix-issue escalation) fail locally in this runner environment. The same tests fail on an unmodified checkout.
The implementation for issue #2056 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 4, 2026
Dev-Lead Implementation Plan
Issue: #2056 — dev-lead fix-reviews reads reviewThreads(first:50) with no pagination
Scope
Replace both unpaginated
reviewThreads(first:50)reads inscripts/dev-lead-fix-reviews.shwith one shared cursor-paginated, fail-closed helper.Implementation Checklist
scripts/lib/open-review-threads.shexposingort_fetch_open_threads <owner/repo> <pr>: paginatesreviewThreads(first:N, after:$cursor)withpageInfo{hasNextPage endCursor}until exhausted, emits a JSON array of unresolved threads (same node shape as today). Returns non-zero (no stdout) when any page fetch fails, returns GraphQLerrors, lacks thereviewThreads.nodesarray, or claimshasNextPagewithout a cursor.scripts/dev-lead-fix-reviews.sh: source the lib;fix-reviewsandhuman-pr|review-changescall the helper; on failure log::error::and exit 1 instead of passing on an empty list.Tests to Write
tests/dev-lead/unit/test_open_review_threads.bats(cursor-aware gh stub serving a fixture): 51 threads with the only open one at Compliance: unpinned-actions-pr-review.yml #51 (page size 50); 101 threads with the open one at chore: remove frameworks directory #101 (page size 100); boundaries at exactly 50/100; failure on page 2 → non-zero + no output; GraphQLerrors→ non-zero; missing nodes → non-zero; hasNextPage w/o cursor → non-zero.tests/dev-lead/unit/test_fix_reviews.bats: both call sites use the helper (noreviewThreads(first:50)left); a failed thread fetch makes fix-reviews / review-changes exit non-zero instead of running on an empty list.Test Command
bats tests/dev-lead/unit/test_open_review_threads.bats tests/dev-lead/unit/test_fix_reviews.bats+bash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Oct 4, 2026
Dev-Lead: Progress (in progress — not yet durable)
Plan Execution (intended)
ort_fetch_open_threadspaginatesreviewThreads(100/page,pageInfo{hasNextPage endCursor}) and fails closed.OPEN_THREADS_JSONcall sites (fix-reviews,human-pr|review-changes) now use it; a failed read logs::error::and exits 1 before the engine runs.Files touched (this workspace, not yet pushed)
scripts/lib/open-review-threads.sh(new): paginated, fail-closed open-thread fetch. Treats a failedghcall, a GraphQLerrorspayload, a missingnodesarray, non-JSON, orhasNextPagewith no cursor as an error.scripts/dev-lead-fix-reviews.sh: sources the lib and replaces bothreviewThreads(first:50)queries.tests/dev-lead/unit/test_open_review_threads.bats(new): cursor-aware fixture stub covering page boundaries at 50 and 100, the PR feat: implement issue #1951 — [Phase 2] Canary go/no-go report: compare deep-tier cost, cache-read cost and latency by model from token-usage artifacts #1953 shape, three-page spread, fail-closed cases, and a large (>128KB) open set.tests/dev-lead/unit/test_fix_reviews.bats: harness tests (open thread chore(deps): bump petry-projects/.github/.github/workflows/agent-shield-reusable.yml from 0cb4bba11d7563bf197ad805f12fb8639e4879e4 to b79962331f28d0fc26c09b441471231ff2df04b8 #166 reaches the prompt for both intents; a failed fetch exits non-zero for both). Two existing fixture stubs now return the GraphQL envelope instead of a pre---jq-filtered array.Notes
[], as the issue asks.don-petry commentedon Oct 4, 2026
Dev-Lead: Implementation Complete — PR #2057
The implementation for issue #2056 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
1e73cd6a685d1347df06928c6815f70e5da33e2emain: 4 file(s), +483/-26 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(reviews): paginated-threads lib review feedback
feat: implement issue #2056 — dev-lead fix-reviews reads reviewThread…
fix(reviews): strip diff marker before token match; fix #2004 gh stub…
feat: implement issue #2004 — A `fixed` disposition citing the WRONG …
fix(reviews): fail closed on tracker-comment pagination errors, split…
fix(reviews): fail closed on tracker-comment pagination errors, split…
test: keep main's open-thread stub comment; cite #2056 for the shared…
feat(dev-lead): retry unprocessed bot review threads (#2046) (#2048)
feat: implement issue #2045 — dev-lead: no deferred/out-of-scope outc…