The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(tinyagents): link child host cancellation token to child scope
Steven Enamakela6c1acb9702b
diff --git a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rsindex 4b53fa4719..f2977283ad 100644--- a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs+++ b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs@@ -73,7 +73,16 @@ pub(crate) fn unary_child_context(.with_max_tool_calls(max_iterations.saturating_mul(8).max(8)).with_max_depth(parent_ctx.config.max_depth()).with_max_turn_output_tokens(max_output_tokens);- parent_ctx.child(child_config, parent_ctx.data.child())+ let child_data = parent_ctx+ .data+ .child()+ .with_cancellation(parent_ctx.cancellation.clone());+ let mut child = parent_ctx.child(child_config, child_data)?;+ // TinyAgents links the child's token to the parent's; point the host+ // carrier at that same linked token so host tools observe the child scope+ // (parent cancel cascades down, child cancel leaves the parent running).+ child.data.cancellation = child.cancellation.clone();+ Ok(child)}impl PayloadSummarizer for SubagentPayloadSummarizer {diff --git a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer_tests.rs b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer_tests.rsindex b1ad758e31..b50ae37ef5 100644--- a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer_tests.rs@@ -57,6 +57,22 @@ fn unary_summarizer_child_inherits_cancellation_workspace_and_lineage() {assert!(child.cancellation.is_cancelled());}+#[test]+fn unary_summarizer_child_host_data_uses_the_linked_child_token() {+ let parent = OpenHumanRunContext::new().into_tinyagents(RunConfig::new("parent-link"));+ let child = unary_child_context(&parent, "summarizer", 1, 128).expect("child context");++ child.cancellation.cancel();+ assert!(child.data.cancellation.is_cancelled());+ assert!(!parent.cancellation.is_cancelled());+ assert!(!parent.data.cancellation.is_cancelled());++ let parent = OpenHumanRunContext::new().into_tinyagents(RunConfig::new("parent-link-2"));+ let child = unary_child_context(&parent, "summarizer", 1, 128).expect("child context");+ parent.cancellation.cancel();+ assert!(child.data.cancellation.is_cancelled());+}+struct UnaryOnlyModel(AtomicBool);#[async_trait]