Skip to content

fix(OMN-13947): suppress runner drift alert noise - #2243

Merged
jonahgabriel merged 5 commits into
devfrom
jonah/omn-13947-runner-alert-noise
Jul 9, 2026
Merged

jonahgabriel merged 5 commits into
devfrom
jonah/omn-13947-runner-alert-noise

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • split runner monitor Slack transitions from raw unhealthy runner drift by introducing alert_count/remediation_target_count
  • treat Docker Up (unhealthy) runners with live listener evidence as degraded, not actionable failures
  • keep auto-bounce behavior intact for missing/stuck/crashloop/wedge/persistent offline-idle remediation targets

Verification

  • uv run pytest tests/unit/observability/runner_health/test_runner_monitor_wedge_detection.py -q
  • bash -n docker/runners/runner-monitor.sh
  • uv run ruff format --check tests/unit/observability/runner_health/test_runner_monitor_wedge_detection.py
  • uv run ruff check tests/unit/observability/runner_health/test_runner_monitor_wedge_detection.py
  • pre-commit via git commit with OMNI_HOME=/Users/jonah/Code/omni_home

Live note

Patched /home/jonah/.omnibase/runners/docker/runners/runner-monitor.sh on .201 using temp file + bash -n + backup. No runner containers were restarted or reset.

Summary by CodeRabbit

  • Bug Fixes
    • Improved runner health reporting so containers showing local activity are treated as “degraded” rather than fully unhealthy.
    • Reduced noisy Slack alerts by sending notifications only when there are actionable fleet issues, with clearer “recovered” and “runner update” messaging.
    • Kept remediation/drift tracking while suppressing Slack output when no actionable remediation target exists.
  • Tests
    • Added end-to-end coverage for degraded detection with local activity and for ensuring Slack alerts remain suppressed during non-actionable churn.

Evidence-Source: OCC#3759
Evidence-Ticket: OMN-13947

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c50345f1-bcc2-4bd5-8089-1634d4bb836d

📥 Commits

Reviewing files that changed from the base of the PR and between 81c69ec and 8c4ece9.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/url-authority-gate.yml
📝 Walkthrough

Walkthrough

This PR updates runner monitor health classification and alert state handling, then adds tests for the new alert suppression behavior. It also disables UV cache reuse in the url-authority-gate workflow job.

Changes

Runner Monitor Alert Logic

Layer / File(s) Summary
Degraded health classification via local listener evidence
docker/runners/runner-monitor.sh
Up-but-not-(healthy) containers are checked for local listener evidence and can be counted as healthy/degraded instead of unhealthy.
Persisted state and alert_count computation
docker/runners/runner-monitor.sh
Adds prev_alert_count, offline_idle_recreate_count, and missing_container_count; computes remediation_targets earlier, derives current_alert_count, and writes the new state fields.
Slack alert/recovery transitions based on alert_count
docker/runners/runner-monitor.sh
Initial alerts, update alerts, recovery messages, and OK logging now key off current_alert_count and prev_alert_count.
Slack call capture and e2e tests
tests/unit/observability/runner_health/test_runner_monitor_wedge_detection.py
Mock Slack calls are logged, exposed in parsed state, and covered by new end-to-end tests for degraded health and non-actionable churn.
Disable UV cache reuse
.github/workflows/url-authority-gate.yml
The url-authority-gate job sets UV_NO_CACHE=1.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ComponentA
  participant ComponentB
  ComponentA->>ComponentB: observable interaction
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: reducing runner drift alert noise in runner monitoring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-13947-runner-alert-noise

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docker/runners/runner-monitor.sh (1)

841-886: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep retrying remediation when the actionable count is unchanged.

With current_alert_count > 0, prev_alert_count > 0, and the same count, execution falls to the final else, logs OK, and never calls auto_bounce. That changes remediation behavior for persistent or swapped same-count targets and can leave actionable runners unrepaired after a skipped/failed bounce.

Proposed fix
 elif [[ $current_alert_count -gt 0 ]] && [[ $prev_alert_count -gt 0 ]] && [[ $current_alert_count -ne $prev_alert_count ]]; then
     # Transition: actionable issue count changed. Raw GitHub/Docker drift count
     # can churn under saturation; do not page on that noise.
     detail=$(printf '%s\n' "${unhealthy_list[@]}")
@@
     log "UPDATE: ${current_alert_count} actionable issue(s) (was ${prev_alert_count}), ${current_unhealthy_count} raw unhealthy. wedge=${wedge_count} crashloop=${crashloop_count} stuck_created=${stuck_created_count} offline_idle_recreate=${offline_idle_recreate_count}. Slack notified."
     auto_bounce "${remediation_targets}"
 
+elif [[ $current_alert_count -gt 0 ]]; then
+    # Ongoing actionable issue with unchanged count: suppress Slack, but keep
+    # remediation behavior active.
+    log "ALERT ongoing: ${current_alert_count} actionable issue(s), ${current_unhealthy_count} raw unhealthy. wedge=${wedge_count} crashloop=${crashloop_count} stuck_created=${stuck_created_count} offline_idle_recreate=${offline_idle_recreate_count}. Slack unchanged."
+    auto_bounce "${remediation_targets}"
+
 elif [[ $current_alert_count -eq 0 ]] && [[ $prev_alert_count -gt 0 ]]; then
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/runners/runner-monitor.sh` around lines 841 - 886, The runner
remediation flow in runner-monitor.sh skips auto_bounce when current_alert_count
stays the same, because the same-count case falls through to the final “OK”
branch. Update the alert-state handling around the
current_alert_count/prev_alert_count checks so persistent actionable issues
still trigger remediation even when the count is unchanged. Keep the
Slack/update logging behavior, but ensure auto_bounce(remediation_targets) runs
for unchanged nonzero actionable alerts, especially in the branch that currently
only handles count changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docker/runners/runner-monitor.sh`:
- Around line 841-886: The runner remediation flow in runner-monitor.sh skips
auto_bounce when current_alert_count stays the same, because the same-count case
falls through to the final “OK” branch. Update the alert-state handling around
the current_alert_count/prev_alert_count checks so persistent actionable issues
still trigger remediation even when the count is unchanged. Keep the
Slack/update logging behavior, but ensure auto_bounce(remediation_targets) runs
for unchanged nonzero actionable alerts, especially in the branch that currently
only handles count changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 583d6de2-6b07-4628-ba32-2eccf2a597e5

📥 Commits

Reviewing files that changed from the base of the PR and between 4e9655d and 25bada6.

📒 Files selected for processing (2)
  • docker/runners/runner-monitor.sh
  • tests/unit/observability/runner_health/test_runner_monitor_wedge_detection.py

@jonahgabriel
jonahgabriel merged commit 76c9861 into dev Jul 9, 2026
145 of 152 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-13947-runner-alert-noise branch July 9, 2026 20:44
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.

1 participant