Skip to content

Match Side-Reviewer Asks to a Head by a Server Stamp, Not the Commit Clock #3882

Closed

Description

@ptr727

side_asked_on_head in scripts/pr_review_side.py, added by #3881, decides whether CodeRabbit or Qodo was already asked for the current head. It does that by comparing each ask comment's server createdAt against the head commit's committedDate. The commit date comes from the committer's local clock, so clock skew moves the comparison.

  • Clock behind. A commit stamped 10:00 that is pushed at 10:20 makes an ask posted at 10:05 for the previous head count for the new head too. A drive loop pushing quickly then skips the side ask on head after head, not just the one missed ask the docstring allows.
  • Clock ahead. A commit stamped 10:30 that is pushed at 10:20 makes an ask posted at 10:25 read as older than the head. A second wait inside that window asks again, which is a duplicate paid round.

Neither bot gates the merge, by the maintainer's decision on #3881, so the cost is a missed or a duplicate side round, never a wrong merge. #3881 keyed on committedDate because a check suite's creation and a check's start both postdate the push. Three fix rounds on that path each produced new defects, so this was deferred rather than fixed in that pull request.

A fix needs a server-side stamp for when the head arrived on the pull request. The candidates are the timeline's HeadRefForcePushedEvent or PullRequestCommit event, or the push's own event where the API exposes one. Done means an ask is matched to a head by a server stamp on both sides, with a test covering a backdated commit and a future-dated one.

Found by the local strict pass over #3881.

Activity

  1. ptr727 commented on Nov 13, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown claim (round 6, group 2, away mode): branch burndown/side-ask-server-stamp.

    Issues: #3882.

    Predicted file set:

    • scripts/pr_review_side.py
    • scripts/pr_review.py (its pull request query only; the file is at 2198 of its 2200-line ceiling, and a split would need scripts/README.md, which another open pull request holds, so this group stops rather than growing it past the ceiling)
    • tests/test_pr_review.py, tests/test_pr_review_policy.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions