Skip to content

fix: use gh run watch instead of manual polling in pr-review Step 5 - #1246

Merged
max-sixty merged 1 commit into
mainfrom
nightly/review-22563641659
Mar 2, 2026
Merged

max-sixty merged 1 commit into
mainfrom
nightly/review-22563641659

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Replace manual sleep/poll loop in pr-review Step 5 with gh run watch (consistent with the running-in-ci skill)
  • Skip Step 5 entirely for self-authored PRs where the bot stays silent (no approval to act on)

Context

Nightly review of 8 Claude CI sessions from the past 24 hours found that the
pr-review skill's Step 5 guidance contradicts the running-in-ci skill:

Skill CI monitoring approach
running-in-ci gh run watch (blocking, efficient)
pr-review Step 5 Manual gh pr view --json statusCheckRollup + sleep 30-60s loops

Sessions that followed running-in-ci (dependabot PR reviews) used 0 poll
iterations. Sessions that followed pr-review (self-authored PR reviews) used
7-43 poll iterations. The worst case (run
22540574040)
spent ~43 minutes polling the benchmarks job on a renovate PR where the bot was
going to stay silent regardless.

Closes #1245

Test plan

  • test_command_pages_and_skill_files_are_in_sync passes
  • Verify next claude-review run uses gh run watch instead of manual polling

🤖 Generated with Claude Code

Replace the manual sleep/poll loop in pr-review Step 5 with `gh run watch`,
consistent with the running-in-ci skill. Also skip CI monitoring entirely
for self-authored PRs where the bot stays silent (no approval to dismiss).

Evidence: run 22540574040 burned 43 poll iterations (~43 min) waiting for the
benchmarks job on a self-authored renovate PR where the bot was going to stay
silent regardless.

Closes #1245

Co-Authored-By: Claude Opus 4.6 <[email protected]>
value.

After approving, wait for CI to finish using `gh run watch` (consistent with
the `running-in-ci` skill). Exclude the current workflow's own check to avoid

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we excluding the current workflow's own check this way?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes — at both stages:

  1. gh run watch targets a specific run found via --workflow ci.yaml, so it only watches the CI workflow, never the current review workflow. The exclusion is implicit by targeting a different workflow's run ID.

  2. The statusCheckRollup verify step still has the select(env.GITHUB_WORKFLOW == null or (.workflowName == env.GITHUB_WORKFLOW | not)) filter, which explicitly drops the current workflow.

So it's actually slightly more robust than before — the old polling loop relied solely on the jq filter, while now the gh run watch step can't circular-wait by construction.

@max-sixty
max-sixty merged commit c24cbdf into main Mar 2, 2026
24 of 25 checks passed
@max-sixty
max-sixty deleted the nightly/review-22563641659 branch March 2, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pr-review: CI polling wastes compute due to skill discrepancy and silent-verdict monitoring

2 participants