Skip to content

[Phase 4] pr-review defers indefinitely on another agent's own check run (dev-lead/dispatch) and on zombie checks — ci-pending has no timeout #1427

Description

@don-petry

Story

As a maintainer waiting for pr-review to approve a PR whose tests are green,
I want the "CI still pending" deferral to ignore other agents' own check runs and to time out on a check that never completes,
so that ordinary dev-lead activity — or a single stuck check — cannot defer the review indefinitely.

Problem — two ways a PR gets stuck at ci-pending forever

scripts/review-one-pr.sh skips with reason:"ci-pending" whenever compute_ci_status sees a non-completed check, posting a <!-- pr-review-agent ci-pending-ack --> comment that says "re-mention @donpetry-bot once they complete." scripts/lib/ci-status.sh deliberately filters the cascade's own check runs (review, review / review, PR Review*) so pr-review never blocks on itself (#469). It does not filter any other agent's checks, and the pending state has no upper bound — a FORCE_REVIEW mention polls only 10×30s before giving up.

Case A — dev-lead's own check defers pr-review (agent-vs-agent interference)

Observed on PR #1420 at 07:48Z: 57 checks COMPLETED, all tests green (bats, unit, unit-tests all SUCCESS), zero unresolved threads, zero genuine failures — and one check IN_PROGRESS: dev-lead / dispatch, started 07:39:01Z. pr-review posted ci-pending-ack at 07:45:08Z and declined to review.

The loop is self-sustaining, and it is easy to enter by trying to help:

  1. Someone comments on the PR (including "@donpetry-bot review", the remedy the ack itself recommends)
  2. The comment is an issue_comment event → dev-lead fires → dev-lead / dispatch check goes IN_PROGRESS
  3. pr-review sees a pending check → defers → posts another ci-pending-ack
  4. Because dev-lead's concurrency is cancel-in-progress: false, queued runs keep at least one dispatch check pending across the window, so step 3 repeats

Every attempt to re-engage the reviewer re-arms the condition that makes it defer. During the observed window, two mention-driven attempts to obtain an approval both ended in ci-pending-ack rather than a review.

Case B — a zombie check never completes

Observed on PR #1426 at 07:48Z: Validate AW specs, docs, and workflows reports status: IN_PROGRESS with conclusion: SUCCESS, started 06:57:49Z — inconsistent, and ~50 minutes stale. A check in this state will not transition, so the ci-pending skip is permanent: pr-review will defer on every future trigger, forever, with no timeout to rescue it.

Both PRs were otherwise fully merge-ready. Nothing has merged since 05:49Z.

Acceptance Criteria

  1. compute_ci_status excludes other first-party agent check runs from the pending calculation — at minimum dev-lead / *, generalised from the existing self-filter rather than hard-coded per agent. A writing agent's own job must not gate the reviewing agent.
  2. The exclusion is derived from a declared source (the interaction contracts from [Phase 2] Author a machine-readable interaction contract for every agentic role, per the standard #1404 name each role's workflows), not a second hand-maintained name list that can drift from the first.
  3. The ci-pending deferral is bounded: after a configurable age, pr-review either proceeds on the completed checks or escalates once, rather than deferring indefinitely. A check that is IN_PROGRESS while carrying a terminal conclusion is treated as complete.
  4. The bound is fail-safe, not fail-open: proceeding past a genuinely pending required check must remain impossible — the timeout applies to the review decision, not to the merge gate, which the rulesets still enforce independently.
  5. The ci-pending-ack comment stops recommending a remedy that re-triggers the condition. Either the ack is dropped for the self-inflicted case, or its text stops advising a re-mention when the only pending check belongs to another agent.
  6. Tests cover: pending dev-lead check + otherwise-green PR → review proceeds; zombie check (IN_PROGRESS + conclusion) → treated as complete; a genuinely pending required check → still defers; the deferral timeout path.

Tasks / Subtasks

Dev Notes

Project Structure Notes

scripts/lib/ci-status.sh (the filter and the pending calculation), scripts/review-one-pr.sh (the skip path and the ack copy); tests under tests/, registered in lint.yml's bats list.

References

Likely target surface

  • scripts/lib/ci-status.sh, scripts/review-one-pr.sh

Filed from overnight monitoring of epic #1402. Found while diagnosing why two fully-green PRs would not attract a code-owner approval: the reviewer was deferring on the writing agent's own check run, and each attempt to re-engage it re-armed that deferral.

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

    bugBug reportsdev-leadFor dev-lead agent pickupinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions