Skip to content

v0.5.0

Choose a tag to compare

@karlkfi karlkfi released this 27 Jul 16:40

Watcher: keep watching past green with PR_SENTINEL_WATCH_UNTIL=closed

The watcher exits on ready, but the PR is still open at that point and sitting in human merge review — exactly the window where a sibling PR merging turns it CONFLICTING. Nothing is left watching, so nothing wakes you. This only bites with concurrent PRs, so it's an opt-in stopping condition rather than a change to the default.

Set PR_SENTINEL_WATCH_UNTIL=closed and the watcher reports green once as a non-terminal ready_watching notice and keeps polling. The DIRTY/BEHIND checks already at the top of the loop still fire, so a later conflict, a branch falling behind, or a newly failing check wakes the session; the watch ends when the PR is merged or closed.

Exiting on a still-green PR and relying on a relaunch does not work: the relaunched watcher re-evaluates immediately, sees the same green state, and exits again with no sleep in the cycle — a spin loop, not a watch.

Trade-offs

  • The session is not woken when the PR turns green, so it can't announce "ready for review" the moment it happens — the notice lands in the watcher's task output instead.
  • A watch that now spans human review time usually wants a larger PR_SENTINEL_TIMEOUT than the 1-hour default, or it wakes with a timeout event and needs a relaunch.

Stop hook

ready_watching is a distinct event name so the Stop hook can tell "handed off" from "green, still watching". A watch in closed mode that exits on the notice without a terminal event now blocks once to relaunch, instead of going quiet on a PR that is still open and unwatched.

Trust boundary unchanged

No new data source: the loop already read mergeStateStatus every cycle. There is still no merge, no comment ingestion, and no fix outside the visible session.

Closes #23.

Full changelog: v0.4.1...v0.5.0