Babysit
Stay on the PR after handoff until it's actually done. Being asked to babysit IS the ask to poll — but report state changes only, no heartbeats, no per-poll narration.
Loop
- Snapshot:
gh pr view <N> --json state,mergeable,mergeStateStatus,reviewDecision,statusCheckRollup,autoMergeRequestplusgh pr checks <N>. - Poll inside bounded shell loops (a single
forwithsleep 30–60between iterations), not one message per check. Keep watcher scripts, logs, and state outside disposable worktrees, and use a stable working directory; other sessions may remove a merged PR's worktree while its watcher is running. If a watcher fails, recheck the service directly and resume only the remainder of the original deadline. A failed monitor is not a failed deployment. - React by cause:
- CI never started → kick it:
git commit --allow-empty -m "chore: kick CI" && git push. - Red caused by this branch → fix it (the
pr-readyloop), push, resume watching on the new SHA. - Flake / infra red → rerun the failed jobs; repeat until green. Note the flake in one line with the run link.
- New review threads → handle per
pr-ready(fix or reply, verify resolved via the forge API), resume.
- CI never started → kick it:
- Repeat until done. A push or rerun is progress, not an exit.
Merging
Arm automerge only when the user explicitly asks to merge or enable automerge. "Make CI green", "babysit", and "watch it" authorize checks and repairs, not merging. End at green with threads resolved unless merge authorization is explicit.
CI quirks
gh run rerunrefusing with "already running" → cancel the run first, then rerun.- A cancelled run showing "no checks reported" is pending, not red — wait for it to re-report before calling it either way.
- Rollup gates ("All required checks pass") go red because a leaf did — diagnose the leaf failure, never the gate.
Done when
Re-query the forge — don't trust that a push went green or a rerun stuck. Merged, or every check green with no unresolved threads. Fail closed: any red or open thread means keep watching. Wrap up with the PR/MR link and what the watch consumed — reruns used, kicks, fixes pushed.
Scope
- In: watching an open PR, kicking stalled CI, rerunning flakes, small branch-caused fixes, late review threads.
- Out: opening or refreshing the PR (
pr-update,cpr), full rebase/red-CI overhauls (pr-ready), other people's PRs (pr-triage), merging unasked.


