PR Watch Loop
FeaturedScheduledAbout PR Watch Loop
This loop runs at a fixed interval. Each round uses gh to list PRs labelled codex-watch together with their status check results. The agent finds PRs that are blocked or failing, deals with what it can, and produces a status report for every watched PR.
Key features
- 01Triggered automatically on an interval
- 02Reads PR number, title, state and check rollup
- 03Limited to PRs labelled codex-watch
- 04Works with Codex and Cursor
Use cases
- 01Keeping an eye on CI for a set of priority PRs
- 02Catching PRs blocked by failing checks early
- 03Giving the team regular updates on PRs in review
- Goal
- PRs labelled codex-watch stay healthy and unblocked.
- Exit when
- Stop when a status report has been delivered for every watched PR.
- Between iterations run
- gh pr list --label codex-watch --json number,title,state,statusCheckRollup
Launch prompt
Paste into Codex / Cursor. The agent repeats the steps below until the exit condition is met.
Start the "PR Watch Loop" loop. Goal: PRs labelled codex-watch stay healthy and unblocked. Step 1: List watched PRs — Run gh pr list to fetch the number, title, state and check rollup of each PR labelled codex-watch. `gh pr list --label codex-watch --json number,title,state,statusCheckRollup` Step 2: Assess health — Use statusCheckRollup and the PR state to separate passing, failing and pending PRs and spot the blocked ones. Step 3: Handle blockers — Work on problems the agent can resolve; for those it cannot, note the reason for the report. Step 4: Write the status report — Record the current state and outstanding items for each watched PR, and confirm none was skipped. Between iterations run: `gh pr list --label codex-watch --json number,title,state,statusCheckRollup` Exit when: Stop when a status report has been delivered for every watched PR.
Steps
Each round runs in order; if the exit condition isn’t met, another round starts, up to 1.
Run gh pr list to fetch the number, title, state and check rollup of each PR labelled codex-watch.
gh pr list --label codex-watch --json number,title,state,statusCheckRollupUse statusCheckRollup and the PR state to separate passing, failing and pending PRs and spot the blocked ones.
Work on problems the agent can resolve; for those it cannot, note the reason for the report.
Record the current state and outstanding items for each watched PR, and confirm none was skipped.
Supported agents
Coding agents that can run this loop directly.