Auto-close Z.ai provider-health incidents with no reset time after a one-hour cool-down
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 opening | incidents | new Z.ai incident soon after close |
|---|---|---|
| under 20 min | 6 | 4 within 18 min (#9751, #9753, #9793, #9794) |
| 44 min or more | 10 | 2 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.
| Before | After | |
|---|---|---|
| Schedule | every 6h (13 */6 * * *) | hourly (13 * * * *) |
| Scheduled run at 13:30 | stays open until someone dispatches recover_issue | closes, because it is at least an hour old by issue created_at |
- A recorded
reset_atstill closes the incident once it passes. A futurereset_atwins over age. - A missing or malformed
created_atkeeps the incident open. - These stay manual:
authenticationand other provider kinds, workflow-scope and task-scope incidents, and the manualrecover_issuepath.
Verification
These tests in .github/scripts/test_agent_provider_health.py cover the change:
test_scheduled_recovery_closes_null_reset_incident_after_cool_downcloses the aged incident for all three kinds. It leaves the incident 59 min old and the undated one open.test_scheduled_recovery_keeps_aged_null_reset_incident_while_unhealthychecks unknown and exhausted quota.test_scheduled_recovery_leaves_credential_and_scoped_incidents_openchecksauthentication, providerother, workflow scope, and task scope.test_scheduled_recovery_closes_only_elapsed_known_windowchecks that an aged incident with a futurereset_atstays open.test_open_incidents_read_normalized_issue_creation_timechecks howcreated_atis parsed.
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.