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 1ee45d7
Browse filesBrowse the repository at this point in the historyBrowse files
hzq
committed
Bound graph json output during serialization
Use the bounded serializer for json() expressions and share the expected text allowance with templates in foreach preflight. Preserve native JSON output and avoid completing oversized results.
Copy file name to clipboardExpand all lines: docs/language.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -274,7 +274,7 @@ 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.
277
+
Preflight checks text expansion while rendering templates and serializing `json()` expressions, including interpolated JSON. Argument expansions use the remaining prepared-text allowance; predicate expansions share a separate **24 MiB UTF-8 budget** per loop. Exceeding either allowance stops before completing the oversized text or dispatching an item.
278
278
279
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.
280
280
@@ -321,6 +321,7 @@ agent "agent/step-block" {
321
321
-`$(input.rows[input.pick] ?? "missing")` selects one array element using a computed zero-based index. Only non-negative safe integers are accepted; an invalid or out-of-range index, a missing element, or a non-array target yields `null`. It does not look up object properties or coerce numeric strings. Subscripts bind before arithmetic and can be chained for nested arrays. Require `graph-array-index-v1` in `GET /health` and upgrade any workers that install such bundles.
322
322
-`$(input.rows[input.pick].title ?? "missing")` reads a fixed field from the selected object without scanning the array. Postfix `.field` binds like `[...]` and can be chained with it. It reads only own data fields, not inherited properties, getters, methods, or reserved names such as `constructor`. A missing field or a non-object target yields `null`; dynamic object keys are not supported. Check `graph-static-field-v1` in `GET /health` and upgrade workers that install bundles using the syntax.
323
323
- Each expression has a separate 262,144-item budget for collection scans and value copies. Array scans reserve their length before iterating; `slice` reserves only the selected range, and array `len` does not scan its elements. Unused short-circuit branches do not spend the budget. Exceeding it raises `expression_budget_exceeded`, not `null`.
324
+
- Outside `foreach` preflight, each expression also allows up to **24 MiB UTF-8** across the `json()` calls it actually executes. The serializer checks before producing oversized output.
0 commit comments