fix(graph): make turn-cap and template checks consistent across validation modes

This commit is contained in:
Dark-Alex-17 committed 2026-09-11 10:56:28 -06:00
1 parent b4c01e0f28
commit 32f4adb71f
4 files changed
+98 -9

No files matched your search

+21
View File
@@ -3647,6 +3647,27 @@ mod tests {
}
}
#[test]
fn map_max_concurrency_non_numeric_index_errors() {
let map = map_with_cap("m", "br", Some("end"), "{{limits[foo]}}");
let branch = llm_with_state_updates("br", &[("output", "{{output}}")], None);
let graph = graph_with(
vec![("m", map), ("br", branch), ("end", end_node("end"))],
"m",
);
let result = validator().validate(&graph);
assert!(
result.errors.iter().any(|e| e.message
== "map node's `max_concurrency` is a string but not a template; write \
an integer or exactly one `{{key}}` with nothing around it"
&& e.node_id.as_deref() == Some("m")),
"a non-numeric index can never resolve and must fail at load: {:?}",
result.errors
);
}
#[test]
fn map_max_concurrency_lone_template_forms_pass() {
for cap in ["{{budget}}", "{{cfg.limits[0]}}", " {{budget}} "] {