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 b0a6dc3
Browse filesBrowse the repository at this point in the historyBrowse files
hzq
committed
Check foreach template text budgets during rendering
Bound text segments and JSON interpolation before concatenation. Use the remaining argument allowance without charging retained text twice, and bound predicate template expansion before dispatch.
Copy file name to clipboardExpand all lines: docs/language.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -274,6 +274,8 @@ The source length is checked **before** filtering. All predicates of one map are
274
274
275
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
+
Preflight checks template expansion while it is being rendered, including interpolated JSON. Argument templates use the remaining prepared-text allowance, and predicate templates share a separate **24 MiB UTF-8 expansion budget** per loop. Exceeding either allowance stops rendering without dispatching an item.
278
+
277
279
`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