Repository navigation
Commit 78e73c2
feat(workflow): add optional precheck gate to skip empty runs
Adds a workflow-level `precheck` evalexpr gate evaluated once at run start,
before any step executes. When it evaluates to false the run short-circuits
with zero step actions (no messages, webhooks, or agent turns) and returns a
completed result with a skipped-precheck trace entry.
This lets a scheduled poller workflow ("every 15m, if there's new work, have
an agent summarize it") cheaply skip empty ticks instead of spinning up the
step chain each time — the same zero-cost-gate pattern we contributed to the
OpenClaw and Hermes cron systems.
- Additive: workflows without `precheck` are unchanged (serde default None).
- Reuses the existing `evaluate_condition` machinery (4 KB expr cap + 100 ms
timeout), so no new execution surface and no shell — same safety envelope
as step `if:` conditions.
- Fail-open: a precheck that errors runs the steps (a bad gate never silently
disables a workflow) and logs a warning.
- Tests: precheck field parse + JSON round-trip + default-None.
Refs #2297
Signed-off-by: Bartok9 <danielrpike9@gmail.com>
(cherry picked from commit d495c95)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
(cherry picked from commit a53cee2)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
(cherry picked from commit 91e2d1a)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
(cherry picked from commit 14f93a7)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>1 parent 4cd82f5 commit 78e73c2
2 files changed
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
1078 | 1108 | | |
1079 | 1109 | | |
1080 | 1110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
334 | 341 | | |
335 | 342 | | |
336 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
337 | 359 | | |
338 | 360 | | |
339 | 361 | | |
| |||
0 commit comments