Add schedule heartbeat check to agent-job-health to catch silent scheduling gaps - #53259
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix audit-workflows schedule issue for reliability monitoring
Add schedule heartbeat check to agent-job-health to catch silent scheduling gaps
Aug 17, 2026
pelikhan
marked this pull request as ready for review
August 17, 2026 01:13
Contributor
There was a problem hiding this comment.
Pull request overview
Adds schedule-heartbeat monitoring to detect workflows that silently stop running.
Changes:
- Checks scheduled workflow cadence and reports blind spots.
- Allows heartbeat failures to trigger deduplicated issues.
- Adds evaluation coverage and recompiles the workflow.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/agent-job-health.md |
Adds heartbeat detection and reporting instructions. |
.github/workflows/agent-job-health.lock.yml |
Updates generated metadata and evaluations. |
Review details
Suppressed comments (2)
.github/workflows/agent-job-health.md:141
- This guarantee conflicts with Phase 0 (lines 70–71), which gives up and calls
noopwhen the logs MCP fails, and with line 197, which still no-ops unconditionally when logs cannot be retrieved. Because this heartbeat uses the separate GitHub Actions API, those failures must not suppress Phase 6; update both fallback paths to continue the heartbeat and report/create an issue when it finds a blind spot.
This check is independent of the last-24-hour run collection in Phase 1 and must always run, even when Phase 1 finds zero runs in the window.
.github/workflows/agent-job-health.md:138
- Handle workflows with zero scheduled runs. The current comparison requires a timestamp, so a newly added workflow whose schedule has never fired can be omitted even after it becomes overdue. Use the Actions workflow creation time as the baseline and flag it once the same threshold is exceeded.
- Flag a **blind spot** when the gap since that last run exceeds `2x` the expected cadence plus one day of slack (for example, a daily workflow silent for more than 3 days, or a weekly workflow silent for more than 15 days).
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
|
|
||
| - List every workflow file with a `schedule:` trigger in `.github/workflows/*.md` frontmatter (exclude the `shared/` includes and workflows whose only trigger is `workflow_dispatch`). | ||
| - For each schedule-triggered workflow, resolve the expected cadence from its cron alias or expression (for example `daily` → 24h, `weekly` → 7d, `hourly` → 1h; for an explicit cron string, derive the implied interval). | ||
| - Use the GitHub Actions API (`list_workflow_runs` on the corresponding `.lock.yml`, any status, most recent first) to find the timestamp of the **most recent run of any kind** (not just successful runs) for that workflow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
audit-workflows— the fleet's own reliability monitor — silently stopped firing for 41 days with no error, alert, or missing-data signal raised anywhere in the fleet. No workflow was watching whether the watchers themselves were still running on schedule.Changes
agent-job-health.md: enumerates allschedule-triggered workflows, derives each one's expected cadence from its cron alias/expression, and looks up the timestamp of its most recent run (any status) via the GitHub Actions API.schedule_heartbeat_checked) to verify the agent performs it.This generalizes the fix beyond
audit-workflowsspecifically — the heuristic applies to any of the ~194 schedule-triggered workflows in the fleet, closing the broader gap where no workflow monitors the monitors' own schedule health.