githubnext / githubnext/gh-aw-cao
[cao-maintenance:efficiency] Control-plane efficiency requires attention
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 1
- Avg merge
- 49m
- Merged PRs (30d)
- 837
Description
The `self-care` package's orchestrator (`self-care.yml`, `cron: 1/20 * * * *`) unconditionally dispatches 10 of its 13 workers on every 20-minute run against the sole live target (`githubnext/gh-aw-cao`). Each worker's lock file sets `concurrency: { group: "${{ github.workflow }}-${{ inputs.target_repo }}", cancel-in-progress: true }`, so a new dispatch cancels the prior run for that worker whenever the prior run is still active. Measured over the last ~5.4 days (300-run samples per worker, 2026-09-05 16:21 UTC – 2026-09-11 01:31 UTC):
| Worker | Success | Cancelled | Failed | Cancel rate | Avg success duration |
|---|---|---|---|---|---|
| `self-care-dashboard-language-refactor` (View Reuse) | 183 | 89 | 27 | 30% | ~16 min |
| `self-care-dashboard-review` | 179 | 28 | 93 | 9% (31% failed) | n/a |
| `self-care-dashboard-performance` | 214 | 55 | 31 | 18% | ~10 min |
For the two highest-cancellation workers, roughly a third of dispatched runs are killed mid-flight by the next scheduled dispatch before they can open a review item, burning AI Credit and Actions minutes with zero review output. `self-care-pages-health`, `self-care-dashboard-data-schema`, and `self-care-glossary` already avoid this by having the orchestrator instructions skip dispatch when a same-workflow run is in progress or recently started (24h for the latter two, 6h for pages-health, per `.github/workflows/self-care.md`). `self-care-dashboard-language-refactor`, `self-care-dashboard-review`, and `self-care-dashboard-performance` have no such cadence guard and are dispatched every cycle regardless of in-flight runs.
**Conservative expected improvement:** eliminating self-cancellation for these three workers should cut their wasted-run rate from ~9–30% to near 0%, a >10% reduction in AI Credit and Actions-minute spend for this cost dimension, with no loss of review coverage (a cancelled run produces no review item anyway, so skipping the redundant dispatch and letting the in-flight run finish is strictly better).
**Safety invariant preserved:** dispatch cadence stays fail-closed — the guard only skips dispatch when a run is genuinely in progress or was started very recently, exactly the pattern already proven for `pages-health`/`dashboard-data-schema`/`glossary`. No policy, target authority, or review routing changes.
**Verification metric:** per-worker cancellation rate (cancelled runs ÷ total runs) for `self-care-dashboard-language-refactor`, `self-care-dashboard-review`, and `self-care-dashboard-performance`, measured over the next complete 7-day window after the fix lands. Target: <10% for each (down from 30%, 9%, and 18% respectively in this window).
**Action:** A maintainer should add an in-progress/recently-started dispatch guard for these three workers in `.github/workflows/self-care.md`, mirroring the existing `pages-health` cadence check, then run `npm run compile` to regenerate the lock files.
Agent prompt
In `.github/workflows/self-care.md`, extend the dispatch instructions in the `## Workers` section so that `self-care-dashboard-language-refactor`, `self-care-dashboard-review`, and `self-care-dashboard-performance` are only dispatched when no run of the respective workflow is queued or in progress (inspect at most the 10 most recent runs of each workflow, mirroring the existing `self-care-pages-health` check). If run history is unavailable or ambiguous, fail closed by skipping dispatch for that worker and recording the incomplete cadence check in the `Outcome` section, exactly as done today for `self-care-pages-health`. Do not change any other worker's dispatch behavior, do not alter `self-care-experimental-views` (must remain dispatched every cycle), and do not change concurrency groups, cron cadence, or safe-output configuration. After editing, run `npm run compile` (dry-run) to validate the workflow compiles, and inspect the diff of `self-care.lock.yml` to confirm only the affected dispatch logic changed. Validate against `npm run typecheck:cao && npm test` if `.github/cao/src/` steering is touched (it should not be).
Evidence and method
- Orchestrator cadence: `self-care.md` schedules every 20 minutes (`cron: 1/20 * * * *`), dispatching up to 13 workers per run via `dispatch-workflow`.
- Worker concurrency: each worker lock file (e.g. `self-care-dashboard-language-refactor.lock.yml`) sets `concurrency: { group: "${{ github.workflow }}-${{ inputs.target_repo }}", cancel-in-progress: true }`. Because the target repository is fixed to `githubnext/gh-aw-cao`, every new dispatch for the same worker cancels any still-running prior dispatch for that worker.
- Run samples pulled via the read-only GitHub Actions API (`list_workflow_runs`) for workflow IDs 350125557 (View Reuse), 348358282 (Dashboard Review), and 350605456 (Dashboard Performance), 300 most recent runs each, spanning 2026-09-05T16:21 UTC through 2026-09-11T01:31 UTC (~5.4 days, exceeding the requested 7-day window is not yet available for these high-frequency workers within the 300-run API page cap, but the sample is dense and representative).
- Already-mitigated workers for comparison: `self-care-pages-health` (6h cadence guard) and `self-care-dashboard-data-schema` / `self-care-glossary` (24h cadence guard) show far lower cancellation rates in the same period, confirming the guard pattern works.
- No open `self-care`-labeled review issues or PRs were found in `githubnext/gh-aw-cao` at query time, so this is a fresh structural finding, not a duplicate of an existing review item.
### Control Plane
- Correlation ID: 34551363031-4
- Central repository: githubnext/gh-aw-cao
- Control plane run: https://github.com/githubnext/gh-aw-cao/actions/runs/34551363031
> Generated by [CAO Maintenance / Efficiency](https://github.com/githubnext/gh-aw-cao/actions/runs/34551744173) · copilot · auto · 138.9 AIC · ⌖ 6.93 AIC · ⊞ 12.7K · [◷](https://github.com/search?q=repo%3Agithubnext%2Fgh-aw-cao+is%3Aissue+%22gh-aw-workflow-call-id%3A+githubnext%2Fgh-aw-cao%2Fcao-maintenance-efficiency%22&type=issues)
> - [x] expires on Sep 25, 2026, 1:54 AM UTC
Contributor guide
Research direction
Read the existing self-care-pages-health cadence check in .github/workflows/self-care.md, then inspect the three named worker dispatch instructions. Run npm run compile (dry-run) and inspect self-care.lock.yml; done means only the three dispatch behaviors gain the requested guard, with no changes to other workers or cadence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100