Skip to content

Commit 3eb23e4

Browse files
authored
Make workflow health reports resumable and fleet-first (#80118)
1 parent 8f567d2 commit 3eb23e4

44 files changed

Lines changed: 2628 additions & 536 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/default-fleet-health.md‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/aw/analyzing-runs.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ not an unrelated checkout. Default to the last 24 hours; record actual repositor
2222
window and collection limits.
2323

2424
For "healthy now" or fix-verification questions, follow
25-
[revision-aware workflow health](debug-workflow-health.md) using `gh aw health --json`.
25+
[revision-aware workflow health](debug-workflow-health.md). Use `gh aw health --json`
26+
for the default-branch fleet or `gh aw health WORKFLOW --json` for a named workflow.
2627
That guide owns source/hash matching, collection completeness, superseded-run
2728
handling, and verification gaps. Keep using `logs` below for historical failures.
2829

‎.github/aw/cli-commands.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ description: Complete reference for gh aw CLI commands and their MCP tool equiva
4444
| `gh aw fix` | `fix` |
4545
| `gh aw upgrade` | `upgrade` |
4646
47-
Local only (no MCP tool): `skill`, `init`, `doctor`, `health`, `experiments`, `format`, `deploy`, `env`, `json-schema`. `gh aw run` has no MCP tool and no API/MCP/manual-dispatch substitution.
47+
Local only (no MCP tool): `skill`, `init`, `doctor`, `experiments`, `format`, `deploy`, `env`, `json-schema`. `gh aw run` has no MCP tool and no API/MCP/manual-dispatch substitution.
48+
49+
For read-only health and checkpoint guidance, see [Check Current Workflow Health](debug-workflow-health.md). Discover the MCP `health` schema before use.
4850
`init` updates use the `upgrade` tool. `audit` covers single runs; BM25
4951
`audit --search` is CLI-only. Inside a workflow step, install
5052
`github/gh-aw/actions/setup-cli` to run local-only commands such as `deploy`.
@@ -223,12 +225,16 @@ gh aw checks <run-id>
223225

224226
Display workflow health metrics, success rates, and revision-aware failure clusters.
225227

228+
Omit the workflow name for a compact default-branch fleet report. In MCP `health`,
229+
omit `workflow_name` for the same scope; pass `next_action.checkpoint` as `resume`
230+
in the same session when `next_action.type` is `resume`.
231+
226232
```bash
227-
gh aw health # Current status of all workflows
233+
gh aw health # Default-branch fleet report
228234
gh aw health <workflow-name> # Detailed metrics for a specific workflow
229235
gh aw health --days 30 --threshold 90 # Bound lookback; warn below 90% success
230236
gh aw health --json # JSON output for programmatic use
231-
gh aw health --start-date -24h --logs-dir ./workflow-logs # Reuse cached logs, no downloads
237+
gh aw health <workflow-name> --start-date -24h --logs-dir ./workflow-logs # Reuse cached logs
232238
```
233239

234240
Reports a bounded current-revision sample: compares `gh-aw-metadata` hashes across

‎.github/aw/debug-model-engine-misconfiguration.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ examples below rather than inferring the target from the current checkout.
2020
before changing model pins or runtimes.
2121

2222
Read the [run artifacts](#5-read-the-run-artifacts) before proposing changes.
23+
For pricing errors, check [pricing evidence](#ai-credit-pricing-rejection-is-separate-from-alias-or-endpoint-resolution).
24+
Follow the [fix order](#3-apply-fixes-in-this-order) and consult the
25+
[version-field mapping](#4-identify-the-version-field-from-the-failing-install-step)
26+
for install failures.
2327
Explanation-only sessions inspect evidence without installing or upgrading.
2428
Preserve intentional pins unless a verified relevant fix requires a change
2529
within the user's authorized scope.
@@ -107,6 +111,8 @@ succeed without showing the sub-agent failure in its final output. Check for
107111
`subagent.failed` events in `usage/aw_session.jsonl`, and for the **Sub-agent
108112
Failed** finding and `deviated` requests in `gh aw audit RUN_ID`.
109113

114+
<!-- instruction-prefix-end -->
115+
110116
### AI-credit pricing rejection is separate from alias or endpoint resolution
111117

112118
`unknown_model_ai_credits` or `Model "<model>" has no AI credits pricing` means
@@ -124,7 +130,7 @@ provider/runtime metadata or an explicitly configured, accurate pricing table;
124130
do not invent a fallback rate, disable the budget, or substitute an older model.
125131

126132
The parent can recover and leave Actions green. After collecting compact usage
127-
with `gh aw logs --artifacts usage`, inspect `gh aw health --logs-dir <cache-dir>`
133+
with `gh aw logs --artifacts usage`, inspect `gh aw health WORKFLOW --logs-dir <cache-dir>`
128134
for `subagent_failures_observed`, invocation counts, and affected run URLs.
129135
Health reuses matching cached summaries without downloading more artifacts;
130136
missing cached evidence does not establish successful delegation.

‎.github/aw/debug-workflow-health.md‎

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,49 @@ description: Verify whether a pushed agentic workflow fix has matching existing-
33
disable-model-invocation: true
44
---
55

6-
# Verify Workflow Health After a Fix
6+
# Check Current Workflow Health
77

8-
Use this route for "is it healthy now?", "did the patch work?", or "can we close
8+
Use this route for fleet health checks, "did the patch work?", or "can we close
99
the investigation?" An older green run cannot verify a new patch. For historical
1010
failure clustering, use [existing-run analysis](analyzing-runs.md) instead.
1111
Follow the [shared strategy](debug-agentic-workflow.md); this is existing-evidence
1212
verification, not authorization to dispatch or rerun a workflow.
1313

1414
## Collect Revision-Aware Health
1515

16-
Use `gh aw health --json` in a matching repository. For a named workflow or a
17-
different checkout, retain the supplied workflow and explicitly scope the repository;
18-
do not broaden to the fleet or infer another repository from the current checkout.
16+
Use `gh aw health --json` against the identified repository. For fleet triage,
17+
start with the last 24 hours unless the user supplied another window. Read the
18+
compact report first; keep checkpoints and any saved evidence private. For a
19+
named workflow, pass its name or path and retain that scope.
20+
If collecting from a source build, substitute the verified binary path from
21+
the [bootstrap](debug-bootstrap.md#2-check-the-cli-and-run-identity).
1922

2023
```bash
21-
gh aw health WORKFLOW --repo HOST/OWNER/REPO --json
24+
health_dir=$(mktemp -d "$TMPDIR/gh-aw-health.XXXXXX") &&
25+
gh aw health --repo HOST/OWNER/REPO --start-date=-24h --timeout 2m \
26+
--checkpoint "$health_dir/checkpoint.json" --json
2227
```
2328

24-
Collection defaults to a two-minute budget. Set `--timeout 30s` for a shorter
25-
check or `--timeout 0` to disable the deadline. Exhaustion returns available
26-
evidence with `collection.partial=true` and `reason=time_budget`; it does not
27-
verify health. Use `DEBUG=cli:health` to trace request progress and timings on
28-
stderr. Increase the budget or narrow the scope when more evidence is needed.
29+
For a named workflow, use `gh aw health WORKFLOW --repo HOST/OWNER/REPO --json`
30+
and inspect its own revision evidence; it does not use the fleet schema.
31+
32+
Fleet mode reports historical default-branch outcomes separately from sampled
33+
current-revision statuses. On `coverage.partial=true`, report `coverage.reason`
34+
and the uncovered scope. `not_collected` means unassessed;
35+
`no_current_revision_runs` means no matching run was found, not that it passed.
36+
If `next_action.type` is `resume`, reuse `--checkpoint PATH` and the same
37+
repository without date flags. A resume preserves the original time window and
38+
branch revision. Use `--full` only when per-workflow evidence is needed.
39+
Report other collection limits rather than blindly retrying. Use
40+
`DEBUG=cli:health` for request timings on stderr.
2941

3042
Use available health evidence when the CLI is unavailable; do not assume that
3143
an MCP equivalent exists without discovering its actual schema.
3244

33-
Health scans the repository's default branch before PR and other branches.
34-
Check `collection.default_branch` and `default_branch_pass_complete`; PR failures
35-
may reflect unmerged code rather than a default-branch regression. Within each
45+
Named checks scan the default branch before PR and other branches.
46+
Check `collection.default_branch` and `default_branch_pass_complete`;
47+
verify the representative run's branch before attributing failures to the default
48+
branch. Within each
3649
branch pass, health inventories registered AW `failure` conclusions from run-list payloads before
3750
any job or revision lookups, then verifies one job-backed representative per
3851
branch/event. `collection.potential_issues` are approximate, list-only signals;
@@ -52,7 +65,8 @@ It samples backward per AW toward five completed first-attempt runs, bounded by
5265

5366
## Match the Source Actually Exercised
5467

55-
Read `collection` and `workflows[].revisions`: compare
68+
Read `scope` and `details.workflows[].revisions` in full fleet output, or
69+
`collection` and `revisions` in the named report: compare
5670
`gh-aw-metadata` frontmatter/body hashes, not repository commits alone.
5771
Health also compares the workflow Markdown source's blob SHA at each supported run
5872
with the pushed branch source, even when the lock file has not been recompiled.

0 commit comments

Comments
 (0)