pub fn is_hidden_node(node_name: &str, tags: &[String]) -> boolExpand description
Check if a node name indicates a hidden (internal) node.
A node is considered hidden when either:
- Its name both starts and ends with
__(e.g.,__route__,__internal__) - It has the
__hidden__tag in its tags list
This follows the convention established by LangGraph’s TAG_HIDDEN mechanism.
Hidden nodes are filtered from:
interrupt_before/interrupt_afterchecks viashould_interruptStreamEvent::Interruptemission in the Pregel loop
§Arguments
node_name- The name of the node to checktags- The tags associated with the node
§Examples
use juncture_core::interrupt::is_hidden_node;
// Hidden by name pattern
assert!(is_hidden_node("__route__", &[]));
assert!(is_hidden_node("__internal_router__", &[]));
assert!(!is_hidden_node("my_node", &[]));
assert!(!is_hidden_node("__incomplete", &[]));
assert!(!is_hidden_node("normal__", &[]));
// Hidden by tag
assert!(is_hidden_node("my_node", &vec!["__hidden__".to_string()]));
assert!(!is_hidden_node("my_node", &vec!["other_tag".to_string()]));