Skip to content

[Bug]: PR watch reports "All checks passed" while a second run of the same check is still in progress #17207

Description

@aharlap

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Use a repo whose workflow runs on both push and pull_request. Pushing a PR branch then starts two runs of the same job on the same head commit.
  2. Open the PR and have an agent call watch_pull_request.
  3. Let the pull_request run finish while the push run is still going.

Expected behavior

No "checks passed" wake while a check run on the head commit is still in progress.

Actual behavior

The wake "All 1 check passed on b986356" arrived at 2026-10-08T04:19:04Z. The head commit's rollup held two runs of Checks / check:

Event Started Completed
pull_request 04:06:10Z 04:18:58Z
push 04:06:13Z 04:23:58Z (in progress at the wake)

Cause

toCheckEntries (apps/server/src/pullRequest/gitHubPullRequestJson.ts) sets each run's at to realTimestamp(completedAt) ?? realTimestamp(startedAt). dedupeChecks (pullRequestChecks.ts) keys both runs as Checks check and keeps the one with the newest at. The finished run's completion time (04:18:58) beats the running run's start time (04:06:13), so the in-progress run drops out. evaluatePullRequestWatch then sees one passed check and reports it.

The dedupe is right for a re-run replacing an earlier attempt. A push run and a pull_request run on the same commit are two live runs, though, and the watch gate loses one of them.

I reproduced this offline by feeding the two runs above to the real dedupeChecks and evaluatePullRequestWatch: the result is checks-passed, count 1.

Possible fix

Compute the watch gate from the rollup before display dedupe, so any in-progress run of a check holds "passed" back. In a re-run we checked (attempt 1 failed, attempt 2 passed), GitHub's rollup listed only attempt 2, so old failed attempts should not block it. Comparing runs by startedAt alone fixes this timing but still drops an in-progress run that started before a finished one.

Workaround

After a "passed" wake, check gh run list --commit <sha> before merging.

Impact

Minor bug or occasional failure

Version or commit

Seen on a 2026-10-08 nightly; the code involved is unchanged in 0.0.46-nightly.20261008.2819 (5e22256) and on main at a4c9494.

Environment

Windows 11, desktop app (nightly), private GitHub repository with no required checks.

Activity

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

    bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions