Skip to content

[Bug]: watch_pull_request can miss late required gates that pass between polls #15362

Description

@ryuudotgg

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

The following sequence reproduces the problem directly in evaluatePullRequestWatch, without starting a live watcher:

  1. Evaluate a watch with passed: false against a PR containing:
    • Tests: required, successful.
    • Smoke Tests: not required, pending.
  2. The evaluator reports checks-passed and returns a watch with passed: true.
  3. Evaluate the returned watch again, keeping the same head SHA and supplying no new comments or conflicts. This time:
    • Tests: required, successful.
    • Smoke Tests: not required, successful.
    • Smoke Tests Gate: a newly appearing required check, already successful.
  4. Observe that the evaluator returns an empty changes array.

This models a dependent required job being created and completing between polling passes. The watcher never observes that job pending.

Expected behavior

When a new required check appears, its successful completion should not be suppressed by the earlier notification for a smaller set of required checks.

The agent should receive an updated required-checks-passed notification even if the new check completed before the next poll.

This report does not request notifications for every optional check or ask the server to determine workflow readiness.

Actual behavior

No new notification is generated.

In apps/server/src/orchestration-v2/pullRequestWatch.ts, the successful-check notification depends on passedNow && !passed. Both values remain true when an additional required check first appears already successful.

I executed the actual evaluator and reproduced this result. As a control, observing the new gate pending before observing it successful does produce another notification.

The reported live incident involved ryuudotgg/forge#605, head 43fe2891e7ce6525818fc04b99677e63e3b74741:

  • Install Smoke completed successfully at 2026-10-03T21:33:17Z.
  • The required Install Smoke Gate was created at 2026-10-03T21:33:17Z.
  • That gate completed successfully at 2026-10-03T21:33:22Z.
  • The agent had already received a required-checks-passed notification and said it would resume once the remaining checks finished. No follow-up was observed before manually resuming it.

The five-second gate lifetime can fall between polling passes. Its timestamps and required status were verified, but the watcher's exact polling history for that incident was not captured.

Impact

Major degradation or frequent failure

Version or commit

0.0.46-nightly.20261003.2632

Environment

No response

Logs or stack traces

{
  "initialRequiredPass": [
    {
      "kind": "checks-passed",
      "count": 1,
      "required": true
    }
  ],
  "newRequiredGateAlreadySuccess": [],
  "requiredGateObservedPendingThenSuccess": [
    {
      "kind": "checks-passed",
      "count": 2,
      "required": true
    }
  ]
}

Screenshots, recordings, or supporting files

No response

Workaround

Manually resume the agent after the remaining checks finish.

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