Repository navigation
Commit 9dd022a
fix(service-automation): keep a dying loop's completed body steps in the run log (#14185)
A `loop` that died mid-sweep discarded its body's `childSteps` wholesale: the
engine splices them into the run's step list only after a SUCCESSFUL node
result, and a loop whose body throws never produces a result at all. A run that
genuinely performed 3 flag writes and 2 notifies before dying reported
`{selected: 5, acted: 0}` and kept no step record of writes already committed.
The danger is the direction, not the arithmetic: `acted: 0` on a failed sweep
reads as "nothing happened, safe to re-run", which for a non-idempotent body
invites double-execution.
A dying container now carries its completed body steps out on the thrown error
-- a non-enumerable symbol brand, the idiom #3863 already uses to mark
un-routable guard refusals on this same throw path -- and the engine's catch
path folds them into the run log where the success path splices `childSteps`.
The error is rethrown unchanged, so failure propagation, `fault`-edge routing,
`$error` and the run's reported error are all untouched.
Claude-Session: https://claude.ai/code/session_016ZC5rNQj3WEet5HAmmAkMs
Co-authored-by: Claude <noreply@anthropic.com>1 parent 67192ce commit 9dd022a
5 files changed
Lines changed: 599 additions & 12 deletions
File tree
- .changeset
- packages/services/service-automation/src
- builtin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments