Skip to content

Fix schedule-triggered workflow false positives and surface disabled-workflow root cause in health monitor - #53881

Merged
pelikhan merged 2 commits into
mainfrom
copilot/agent-job-health-fix-scheduled-workflows
Aug 19, 2026
Merged

Fix schedule-triggered workflow false positives and surface disabled-workflow root cause in health monitor#53881
pelikhan merged 2 commits into
mainfrom
copilot/agent-job-health-fix-scheduled-workflows

Conversation

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

The Agent Job Health Monitor flagged craft, daily-hippo-learn, and smoke-ci as scheduled workflows that silently stopped firing. Investigation found each had a different root cause, none of which was an actual code or cron bug.

Findings

  • craft: false positive — only real trigger is on.slash_command; the schedule: text the monitor matched was an example snippet in the markdown body (documentation shown to the craft agent), not real frontmatter. craft.lock.yml has no schedule trigger.
  • daily-hippo-learn and smoke-ci: both have GitHub Actions state: disabled_manually. Their compiled .lock.yml schedule triggers are correct and match source — the workflows were simply switched off, not misconfigured.

Changes

  • Phase 6 (Schedule Heartbeat Check) prompt hardening in agent-job-health.md:
    • Restrict schedule-trigger detection to the actual YAML frontmatter block (between the leading --- delimiters) instead of scanning the whole markdown body, eliminating false positives from documentation/example content.
    • Fetch each flagged workflow's state via get_workflow and, when it's disabled_manually/disabled_inactivity, report that explicitly as the root cause with a recommendation to re-enable, instead of reporting an undiagnosed blind spot.
  • Recompiled all workflows; only agent-job-health.lock.yml changed as a result.

Follow-up outside this PR's scope

daily-hippo-learn and smoke-ci still need to be re-enabled by someone with actions:write access, e.g.:

gh workflow enable daily-hippo-learn.lock.yml
gh workflow enable smoke-ci.lock.yml

No agentic workflow in this repo is granted actions:write, so this can't be automated from within a workflow run.

… disabled-workflow root cause

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix schedule-triggered workflows not invoking on time Fix schedule-triggered workflow false positives and surface disabled-workflow root cause in health monitor Aug 19, 2026
Copilot AI requested a review from pelikhan August 19, 2026 01:11
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for working on the Agent Job Health Monitor fix! 🩺 This is a solid hardening of the schedule-trigger detection logic — restricting the YAML scan to frontmatter (between --- delimiters) eliminates the false positive on craft, and adding explicit detection of disabled_manually / disabled_inactivity states makes the blind spots crystal clear.

What looks good:

Minor note:
The PR is still in draft. Once ready for review, marking it ready will signal to maintainers that the investigation is complete and the solution is solid.

Generated by ✅ Contribution Check · auto · 59.7 AIC · ⌖ 4.1 AIC · ⊞ 9.2K ·

@github-actions

Copy link
Copy Markdown
Contributor

Triage: category=bug · risk=low · score=35/100 (impact 15/50, urgency 10/30, quality 10/20)
Recommended action: batch_review

Tiny targeted fix (4+/3-) for health-monitor false positives. Draft — undraft to run CI; low risk, ready for quick batch review alongside other monitor/docs PRs.

Generated by 🔧 PR Triage Agent · auto · 58.8 AIC · ⌖ 2.56 AIC · ⊞ 8.3K ·

@pelikhan
pelikhan marked this pull request as ready for review August 19, 2026 09:52
Copilot AI balanced review requested due to automatic review settings August 19, 2026 09:52
@pelikhan
pelikhan merged commit 7dc95c2 into main Aug 19, 2026
@pelikhan
pelikhan deleted the copilot/agent-job-health-fix-scheduled-workflows branch August 19, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Hardens schedule-health monitoring to avoid false positives and identify disabled workflows.

Changes:

  • Restricts schedule detection to YAML frontmatter.
  • Reports disabled workflow states and re-enable guidance.
  • Refreshes generated lock metadata.
Show a summary per file
File Description
.github/workflows/agent-job-health.md Updates heartbeat-check instructions.
.github/workflows/agent-job-health.lock.yml Updates the generated body hash.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +135 to +139
- List every workflow file with a `schedule:` trigger declared in the actual YAML frontmatter block of `.github/workflows/*.md` (the content between the first two `---` delimiters only — ignore any `schedule:` text that appears in the markdown body, such as documentation examples or sample snippets, which do not represent real triggers). Exclude the `shared/` includes and workflows whose only frontmatter 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.
- 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).
- For each blind spot, record: workflow name, `.lock.yml` path, last observed run timestamp, expected cadence, and the gap size in days.
- Before reporting a blind spot, also fetch the workflow's `state` (via `get_workflow` on the `.lock.yml`). If `state` is `disabled_manually` or `disabled_inactivity`, that is the root cause (not a silent cron misfire) — call this out explicitly in the report and recommend re-enabling the workflow (for example `gh workflow enable <workflow>`) rather than treating it as an undiagnosed schedule blind spot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agent-job-health] 3 scheduled workflows have silently stopped triggering (craft, daily-hippo-learn, smoke-ci)

3 participants