You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automation run observability follow-ups (#2585): retention for `sys_automation_run` run history, and durable single-run detail.
6
+
7
+
**Retention (closes the unbounded-growth risk #2581 introduced).** Terminal run-history rows are now bounded by default, ADR-0057 posture:
8
+
9
+
- A write-time per-flow cap keeps the newest 100 terminal runs per flow (`runHistoryMaxPerFlow`, `0` disables).
10
+
- A default-on periodic sweep deletes terminal rows older than 30 days (`runHistoryRetentionDays`, `0` disables; `runHistorySweepMs` tunes the interval, default 1 h).
11
+
- Suspended (`paused`) rows are live resumable state and are never pruned.
12
+
13
+
**Durable single-run detail.**`AutomationEngine.getRun(runId)` now falls back to the durable history row when the run is no longer in the in-memory buffer (e.g. after a restart), and terminal rows persist a bounded per-node step log (`steps_json`: newest 200 steps, stacks stripped, 64 KB cap) — so "open a past failed run and see which node blew up" survives a restart. New `SuspendedRunStore.loadTerminal(runId)` backs this; `RunRecord` gains `finishedAt` and `steps`.
`[Automation] run-history retention on (terminal runs > ${retentionDays}d pruned every ${Math.round(sweepMs/1000)}s; cap ${this.options.runHistoryMaxPerFlow??DEFAULT_MAX_TERMINAL_RUNS_PER_FLOW}/flow at write)`,
222
+
);
223
+
});
224
+
}
225
+
166
226
// #1870 — bridge `script`-node function calls to the host function
167
227
// registry. ObjectQL holds the name→handler map populated from
168
228
// `bundle.functions` / `defineStack({ functions })` (the same registry
@@ -422,6 +482,10 @@ export class AutomationServicePlugin implements Plugin {
0 commit comments