rcourtman
2f967406df
perf(ai): gate and batch Patrol's per-alert auto-resolve model calls
...
Production telemetry (30d) shows Patrol averaging ~9.4 billed AI calls
per run while only ~1-2 come from the analysis passes. The remainder is
the alert auto-resolve review: one QuickAnalysis call per active alert
(>=10min old) on every run, re-asking the model about the same standing
alert every interval even when the trigger condition demonstrably still
holds.
Two structural changes, both resolution-neutral:
- Still-firing gate: skip the model review for alerts whose current
snapshot still shows the trigger condition (metric at/above threshold,
offline resource still offline). A correct review could only answer
KEEP, so the question is not worth a billed call. The gate never
resolves anything locally - uncertain cases (unknown types, missing
resources, unmapped metrics) still go to the model, which retains
sole authority over resolution.
- Batched review: the remaining candidates are reviewed in one model
call per 20 alerts (numbered verdict lines, unparseable -> KEEP,
bare-RESOLVE fallback for single-alert batches) instead of one call
per alert.
Steady-state runs with standing alerts drop from N review calls to 0;
runs where conditions may have cleared pay ceil(K/20) instead of K.
QuickAnalysisRequest gains a TargetType tag (recorded on the usage
event) so cost telemetry can decompose alert-review spend from the
main patrol pass going forward. Contract updated in-commit
(ai-runtime: model-owned resolve direction, cost-gated keep direction,
batched review, fail-safe parsing, alert_autoresolve usage tagging).
2026-07-17 23:23:38 +01:00
..
2026-06-23 17:26:15 +01:00
2026-07-01 10:38:57 +01:00
2026-03-18 16:06:30 +00:00
2026-07-16 22:50:11 +01:00
2026-03-18 16:06:30 +00:00
2026-05-21 15:15:23 +01:00
2026-07-14 18:24:33 +01:00
2026-07-15 18:44:33 +01:00
2026-05-15 12:22:52 +01:00
2026-06-03 12:29:37 +01:00
2026-05-25 18:02:28 +01:00
2026-03-29 14:18:20 +01:00
2026-03-18 16:06:30 +00:00
2026-06-10 09:38:52 +01:00
2026-06-09 09:43:21 +01:00
2026-07-16 15:17:45 +01:00
2026-03-18 16:06:30 +00:00
2026-07-16 19:55:44 +01:00
2026-04-01 14:47:58 +01:00
2026-07-16 22:56:24 +01:00
2026-07-16 13:40:38 +01:00
2026-07-17 23:20:44 +01:00
2026-06-27 14:43:09 +01:00
2026-05-01 20:28:11 +01:00
2026-07-16 15:17:45 +01:00
2026-03-30 13:34:08 +01:00
2026-03-30 13:34:08 +01:00
2026-01-25 21:08:44 +00:00
2026-05-07 01:24:57 +01:00
2026-05-07 01:24:57 +01:00
2025-12-29 13:49:04 +00:00
2026-03-18 16:06:30 +00:00
2025-12-29 13:49:04 +00:00
2026-01-01 22:29:15 +00:00
2025-12-12 11:29:47 +00:00
2026-03-18 16:06:30 +00:00
2025-12-12 14:26:10 +00:00
2026-06-23 17:26:15 +01:00
2026-06-23 17:26:15 +01:00
2026-05-10 21:57:39 +01:00
2026-06-03 12:29:37 +01:00
2026-07-11 11:25:52 +01:00
2026-07-11 12:02:05 +01:00
2026-05-17 21:59:39 +01:00
2026-06-03 12:29:37 +01:00
2026-04-09 20:15:17 +01:00
2026-01-25 21:08:44 +00:00
2026-07-12 05:23:02 +01:00
2026-07-13 21:51:33 +01:00
2026-05-12 22:23:55 +01:00
2026-05-12 22:23:55 +01:00
2026-01-30 19:02:14 +00:00
2026-05-11 11:40:07 +01:00
2026-01-30 19:02:14 +00:00
2026-01-30 19:02:14 +00:00
2026-06-23 17:26:15 +01:00
2026-06-10 09:38:52 +01:00
2026-06-09 21:42:21 +01:00
2026-05-13 11:35:24 +01:00
2026-05-13 05:42:25 +01:00
2026-05-13 11:35:24 +01:00
2026-05-13 11:35:24 +01:00
2026-06-30 10:37:54 +01:00
2026-07-11 11:25:52 +01:00
2026-07-13 16:05:44 +01:00
2026-07-17 17:29:22 +01:00
2026-06-09 21:42:21 +01:00
2026-05-13 01:13:38 +01:00
2026-03-30 13:34:08 +01:00
2026-05-13 02:41:45 +01:00
2026-05-13 02:41:45 +01:00
2026-05-13 02:41:45 +01:00
2026-03-18 16:06:30 +00:00
2026-06-30 10:37:54 +01:00
2026-02-01 10:12:23 +00:00
2026-06-23 17:26:15 +01:00
2026-06-23 17:26:15 +01:00
2026-06-09 21:42:21 +01:00
2026-05-13 04:18:27 +01:00
2026-05-13 04:18:27 +01:00
2026-06-30 10:37:54 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-06-23 17:26:15 +01:00
2026-03-19 04:15:26 +00:00
2026-06-23 17:26:15 +01:00
2026-07-10 21:22:06 +01:00
2026-07-10 21:22:06 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 17:22:24 +00:00
2026-07-10 13:02:26 +01:00
2025-12-12 13:49:37 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2025-12-29 13:49:04 +00:00
2025-12-12 09:45:57 +00:00
2026-03-18 16:06:30 +00:00
2026-06-08 07:21:38 +01:00
2026-07-10 00:14:01 +01:00
2026-07-06 10:08:36 +01:00
2026-07-14 17:31:05 +01:00
2026-07-16 06:40:17 +01:00
2026-07-14 15:35:48 +01:00
2026-07-15 20:42:17 +01:00
2026-02-01 18:07:41 +00:00
2026-07-16 06:40:17 +01:00
2026-07-17 23:23:38 +01:00
2026-06-23 17:26:15 +01:00
2026-06-23 17:26:15 +01:00
2026-07-14 19:23:36 +01:00
2026-05-07 18:24:47 +01:00
2026-07-14 15:35:48 +01:00
2026-06-27 22:18:09 +01:00
2026-07-14 22:33:40 +01:00
2026-07-16 14:06:01 +01:00
2026-02-04 19:56:12 +00:00
2026-05-08 11:08:53 +01:00
2026-05-08 11:08:53 +01:00
2026-07-15 10:49:16 +01:00
2026-06-15 10:08:54 +01:00
2026-07-16 14:06:01 +01:00
2026-05-01 20:28:11 +01:00
2026-06-10 09:38:52 +01:00
2026-02-01 16:27:25 +00:00
2026-03-18 16:06:30 +00:00
2026-05-15 14:51:15 +01:00
2026-07-16 09:54:34 +01:00
2026-07-16 09:54:34 +01:00
2026-05-01 20:28:11 +01:00
2026-05-01 20:28:11 +01:00
2026-07-17 23:20:44 +01:00
2026-07-17 23:20:44 +01:00
2026-06-23 19:38:22 +01:00
2026-03-30 13:34:08 +01:00
2026-07-17 23:23:38 +01:00
2026-07-14 22:33:40 +01:00
2026-07-17 23:23:38 +01:00
2026-07-17 23:23:38 +01:00
2026-07-14 23:23:14 +01:00
2026-07-14 16:34:19 +01:00
2026-07-10 12:04:03 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-06-29 18:17:24 +01:00
2026-03-18 16:06:30 +00:00
2026-06-29 18:17:24 +01:00
2026-07-14 15:35:48 +01:00
2026-03-18 16:06:30 +00:00
2026-06-09 21:47:14 +01:00
2026-01-24 22:41:43 +00:00
2026-07-14 19:23:36 +01:00
2026-07-15 20:42:17 +01:00
2026-07-15 20:42:17 +01:00
2026-05-13 00:28:24 +01:00
2026-06-15 10:08:54 +01:00
2026-07-14 15:35:48 +01:00
2026-07-14 17:31:05 +01:00
2025-12-12 14:11:28 +00:00
2026-05-10 19:30:54 +01:00
2026-05-10 19:30:54 +01:00
2026-05-10 21:23:12 +01:00
2026-05-10 22:02:10 +01:00
2026-05-10 21:08:51 +01:00
2026-05-10 22:02:10 +01:00
2026-06-09 09:43:21 +01:00
2026-06-09 09:43:21 +01:00
2026-06-08 15:21:51 +01:00
2026-06-09 09:43:21 +01:00
2026-03-19 04:07:47 +00:00
2026-03-19 04:07:47 +00:00
2026-03-18 16:06:30 +00:00
2026-03-30 13:34:08 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2025-12-10 08:35:24 +00:00
2026-06-08 03:48:33 +01:00
2026-07-17 17:29:22 +01:00
2026-05-15 16:28:17 +01:00
2026-07-13 21:51:33 +01:00
2026-07-12 13:29:21 +01:00
2026-07-12 13:29:21 +01:00
2026-03-18 16:06:30 +00:00
2026-07-17 23:23:38 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00