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
{{ message }}
Repository navigation
Commit d0c69cc
Browse filesBrowse the repository at this point in the historyBrowse files
hzq
committed
Prepare all selected foreach arguments before dispatch
Resolve argument references and expressions for the selected items as part of bounded preflight. Reuse prepared arguments for retries, leave unused fallbacks lazy, and retain the existing dispatch-time tool authorization.
Copy file name to clipboardExpand all lines: docs/language.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -272,7 +272,7 @@ A step can be followed by modifiers, each at most once. An item predicate follow
272
272
273
273
The source length is checked **before** filtering. All predicates of one map are checked before its first tool call. Rejected items have no tool call, approval or fallback. If only source items 1 and 3 match step `send`, their execution IDs are `send_1` and `send_3`; the result is a compact array in source order. No matches yields `[]`. A false whole-step `when` still yields `{skipped: true}`. Neither loop limits nor tool budgets increase.
274
274
275
-
Each `foreach` preflight shares a **1,048,576-item collection budget** across its source snapshotand all predicates, including reference copies and template serialization in those predicates. The per-expression limit still applies. If the preflight exceeds its budget, it raises `expression_budget_exceeded` before dispatching any item in that loop.
275
+
Each `foreach` preflight shares a **1,048,576-item collection budget** across its source snapshot, predicates, and the arguments of selected items. Reference copies and template serialization count, and the per-expression limit still applies. All selected arguments are resolved before the first item is dispatched, and reused on retries. Prepared argument strings and keys may occupy up to **24 MiB of UTF-8 text** per loop. An invalid reference or excess work or text fails preflight before any item is dispatched. Unselected arguments and unused fallbacks are not evaluated, and tool-specific validation and authorization still apply at dispatch.
276
276
277
277
`retry` and `timeout` are allowed only on read-only or `idempotent-write` tools; otherwise compilation reports `unsafe_graph_retry`. While waiting for approval, when the run is cancelled, or when the outcome of a side effect is unknown, there is no retry, and the failure is not hidden by a fallback value.
0 commit comments