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(session_host): clear stale dispatch refusal on later driver failure
Steven Enamakelac0dbcebd09a
diff --git a/crates/openhuman-core/src/agent/session_host/driver.rs b/crates/openhuman-core/src/agent/session_host/driver.rsindex 740a7407da..8fe3c97424 100644--- a/crates/openhuman-core/src/agent/session_host/driver.rs+++ b/crates/openhuman-core/src/agent/session_host/driver.rs@@ -587,12 +587,10 @@ fn driver_error_with_snapshot(let dispatch_refusal = error.chain().find_map(|cause| {cause.downcast_ref::<crate::agent::tinyagents::budget::DispatchRefusal>()});- if let Some(refusal) = dispatch_refusal {- sidecar- .lock()- .unwrap_or_else(|poisoned| poisoned.into_inner())- .dispatch_refusal = Some(*refusal);- }+ sidecar+ .lock()+ .unwrap_or_else(|poisoned| poisoned.into_inner())+ .dispatch_refusal = dispatch_refusal.copied();let typed = error.chain().find_map(|cause| cause.downcast_ref::<tinyagents_harness::TinyAgentsError>());diff --git a/crates/openhuman-core/src/agent/session_host/driver_tests.rs b/crates/openhuman-core/src/agent/session_host/driver_tests.rsindex d3b752b9e7..1a17fe3516 100644--- a/crates/openhuman-core/src/agent/session_host/driver_tests.rs+++ b/crates/openhuman-core/src/agent/session_host/driver_tests.rs@@ -74,6 +74,25 @@ fn physical_dispatch_refusal_survives_the_neutral_driver_error_boundary() {assert_eq!(usage.output_tokens, 3);}+#[test]+fn a_later_driver_failure_clears_a_child_refusal_the_parent_handled() {+ let sidecar = sidecar();+ sidecar.lock().unwrap().dispatch_refusal =+ Some(crate::agent::tinyagents::budget::DispatchRefusal::new(+ crate::agent::tinyagents::budget::DispatchRefusalReason::CallLimit,+ ));+ let snapshot = Arc::new(std::sync::Mutex::new(Default::default()));++ let _failure = driver_error_with_snapshot(+ anyhow::anyhow!("later unrelated root failure"),+ &snapshot,+ &sidecar,+ std::time::Duration::from_millis(1),+ );++ assert!(sidecar.lock().unwrap().dispatch_refusal.is_none());+}+#[test]fn stalled_model_stream_reports_completed_evidence_instead_of_its_narration() {let snapshot = Arc::new(std::sync::Mutex::new(