Skip to content

Review agent should check PR CI status before finalizing verdict #833

Description

@fullsend-ai-retro

What happened

On PR #211, the review bot (run 32017692283) issued request-changes with 10 findings (2 high, 4 medium, 4 low) focusing on stale references and config drift. Meanwhile, all functional tests were failing with HTTP 403 (GitHub connectivity broken from sandbox) — a critical runtime regression the bot did not mention. The human reviewer (waynesun09) discovered this by downloading CI artifacts and reading test output. The review agent has GitHub API access (it fetches file contents via gh api) but never checks statusCheckRollup or PR check status. The only CI-status-aware code in the repo is the merge-queue skill's await-and-enqueue.sh — the review pipeline has no CI integration at all.

What could go better

If the review agent had checked CI status before finalizing its verdict, it would have discovered that functional tests were 100% failing. This context would have: (1) elevated the review from config-drift findings to a critical connectivity regression, (2) prevented the bot from claiming verification of things CI proved were broken, (3) given sub-agents runtime signal to correlate with their static analysis. The human reviewer's most impactful contributions all came from CI artifact analysis — the agent could have replicated this with a simple API call. Confidence is high that this would have changed the review outcome. Note: agents#394 (CI workflow correctness checks) is distinct — it proposes checking CI workflow YAML files for correctness, not checking CI run status.

Proposed change

Add a CI status check step to skills/pr-review/SKILL.md in the orchestrator instructions, after fetching the PR diff and before dispatching sub-agents:

  1. Add an instruction: "Before dispatching sub-agents, check the PR's CI status by running gh pr checks $PR_NUMBER --repo $REPO_FULL_NAME or querying the statusCheckRollup via GraphQL. If any required checks are failing, prepend a prominent notice to the review body: '⚠ CI checks are failing — findings below should be evaluated in light of runtime failures.' Pass a one-line CI status summary (e.g., 'CI: 3/7 checks failing — functional-tests FAILURE, lint SUCCESS') to each sub-agent's context so they can correlate static findings with runtime failures."

  2. In the review result schema (schemas/review-result.schema.json), consider adding an optional ci_status field (e.g., {"passing": 4, "failing": 3, "pending": 0}) so downstream consumers (post-review.sh, merge-queue) can see the CI state at review time.

  3. In the severity-filtering logic in scripts/post-review.sh, consider auto-elevating the review action to request-changes if CI checks are failing, regardless of finding count — a passing review with failing CI sends a contradictory signal.

Validation criteria

The next 5 review runs on PRs with at least one failing CI check should mention the CI failure status in their review body. Reviews on PRs with all-green CI should not contain spurious CI warnings. Measure by checking the review body text of the next 10 review runs for CI status references and correlating with actual CI status at the time of review.


Generated by retro agent from #211

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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions