Auto-close Z.ai provider-health incidents with no reset time after a one-hour cool-down

Merged
DS
2mo ago
+121-25

This pull request was posted by Claude Code using claude-opus-5-5 on behalf of David.

No tracking issue. Follows incident #10310 and the controller from #9574.

Why we make these changes

While a Z.ai provider-health incident is open, every Z.ai agent workflow skips inference. CI Review is one of them. The scheduled monitor auto-closed only incidents with a recorded, elapsed reset_at, and the controller records one only when a quota window is at 0%. A concurrency 429 (rate_limit) or a failed quota check (quota_unknown) never gets one. All 16 Z.ai incidents since 2026-10-02 had reset_at: null, so each one waited for a manual recover_issue dispatch. That dispatch runs the same fresh health check the schedule runs. The worst cases: #10081 was open 67h, #9975 20h, #10018 13h, and #10310 6h.

Why one hour. A healthy quota check does not show spare request concurrency, so for rate_limit the hour is the real recovery signal. The incident history supports it:

closed after openingincidentsnew Z.ai incident soon after close
under 20 min64 within 18 min (#9751, #9753, #9793, #9794)
44 min or more102 within 30 min (#9806, #10037)

The rule applied to the old 6h scheduled runs would have closed 8 of the 9 incidents open more than 4h after 1.2–6.2h, instead of 6.3–67h. Hourly checks should bring that to about 1–2h, depending on cron delay. That figure is an estimate; hourly checks did not exist to replay.

Trade-off. An hourly schedule runs the quota check six times as often. One unknown result from the scheduled run opens an incident that blocks Z.ai workflows for 1–2h. Since 2026-10-02, the scheduled run opened 1 of the 16 Z.ai incidents (#9914). Agent workflow gates opened the other 15.

New public surface

none

User-visible behavior

Take a zai incident of kind rate_limit, quota_exhausted, or quota_unknown, with reset_at: null, opened at 12:18. The fresh check is healthy.

BeforeAfter
Scheduleevery 6h (13 */6 * * *)hourly (13 * * * *)
Scheduled run at 13:30stays open until someone dispatches recover_issuecloses, because it is at least an hour old by issue created_at
  • A recorded reset_at still closes the incident once it passes. A future reset_at wins over age.
  • A missing or malformed created_at keeps the incident open.
  • These stay manual: authentication and other provider kinds, workflow-scope and task-scope incidents, and the manual recover_issue path.

Verification

These tests in .github/scripts/test_agent_provider_health.py cover the change:

The agentic workflow guard and pyright -p .github/scripts both pass.

What changes for existing users

Nothing. This is repository CI only.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
  • PR title is fit for the release changelog.