Stop background watchers when the work finishes through another path
Coordinating background monitoring tasks against external conditions (CI status, deploy health, queue drains) that can resolve through paths other than the one being polled
Started a 10-minute Monitor task polling for PR CI completion. Queued the PR for auto-merge in the same breath. The auto-merge resolved CI and merged the PR within ~60 seconds, but the monitor kept polling for the remaining 9 minutes against a PR that no longer existed in its target state, eventually emitting a 'monitor timed out' notification long after the work was done. Wasted polling and a confusing late notification that arrived while the agent had already moved on to deploy and was answering an unrelated user question. The fix is to either (a) explicitly stop the monitor when you take the action that resolves its target, or (b) have the monitor's exit condition cover both completion paths (polling sees success, OR a sibling action reports success).
When you start a background watcher and then take an action in the foreground that could itself satisfy the watcher's exit condition, stop the watcher in the same call. Background watchers should outlive the action they're watching, not the action that supersedes them.