Skip to content

Reject non-advancing GitHub review-thread cursors - #1670

Merged
mergify[bot] merged 1 commit into
mainfrom
lean178/1659-review-pagination
Nov 26, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
lean178/1659-review-pagination

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Reject non-advancing GitHub review-thread cursors

Context and goal

  • Context: Review eligibility and finding resolution read GitHub review threads and replies in pages.
  • Problem: A missing or previously seen cursor can cause the same page to be requested indefinitely.
  • Goal: Fail closed when a review-thread scan cannot advance, while continuing to accept normal multi-page history.

Closes #1659

Acceptance

  • Reject a missing, repeated, or cycling cursor before requesting another page.
  • A failed reply scan must not post a reply or resolve the thread.
  • Cover the cursor faults using the existing GitHub fake and retain normal pagination.

Base

main @ 91d2e10

Validation

Recorded for 94e40dc19c8a

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Review

  • primary, claude, 94e40dc, approve

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Architecture-Review: unchanged; review and readiness use the existing read errors when pagination cannot advance.
Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by claude on 94e40dc19c8a240b014fc7539ef7aa9f5f9de13f, 16.5s: approve (0 critical, 0 important, 1 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread tests/test_github.py
assert len(gh.calls) == len(cursors)


def test_thread_reply_read_rejects_repeated_cursor(gh: FakeGh) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: No test checks that a failed reply scan blocks the reply and resolve mutations

The acceptance criteria say a failed reply scan must not post a reply or resolve the thread. The code meets this: resolve_finding calls _has_thread_reply at github.py:1084, before _REPLY_MUTATION and _RESOLVE_MUTATION, so the GhError stops the flow before either mutation runs. The new test calls the private _has_thread_reply directly, though, so nothing protects that ordering. If someone later reorders the code or catches GhError around the reply check, the tests would still pass while the change silently posts or resolves. Smallest fix: add a test that calls github.resolve_finding(...). The thread page should have a comments pageInfo with hasNextPage=True, endCursor="C1", and the reply page should repeat C1. Assert that GhError is raised and that no recorded gh call contains addPullRequestReviewThreadReply or resolveReviewThread.

@eowca
eowca marked this pull request as ready for review November 26, 2026 08:24
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 658dce9 at 08:29 UTC

5 min in the queue, 4 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 08:24 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1706
  • ✅ Merged 08:29 · 658dce9 · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit 658dce9 into main Nov 26, 2026
20 of 21 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1659-review-pagination branch November 26, 2026 08:29
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.

Reject non-advancing GitHub review-thread cursors

1 participant