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
style: apply rustfmt formatting across plan review and tool code
Steven Enamakel1135f1734cff
diff --git a/crates/openhuman-core/src/agent/tools/plan_exit.rs b/crates/openhuman-core/src/agent/tools/plan_exit.rsindex cfdecdd27e..b2be5311dd 100644--- a/crates/openhuman-core/src/agent/tools/plan_exit.rs+++ b/crates/openhuman-core/src/agent/tools/plan_exit.rs@@ -93,7 +93,8 @@ impl PlanExitTool {return Ok(ToolResult::error("`plan` must not be empty"));}if let Some(thread_id) = context.and_then(ToolRunContext::thread_id) {- let dispatch_ctx = crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(context);+ let dispatch_ctx =+ crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(context);let tenant = dispatch_ctx.tenant().ok();// Only flip to Build when there is no plan review still parked on// this thread. A review resolves (approve/reject/revise) before@@ -108,8 +109,7 @@ impl PlanExitTool {crate::plan_review::gate::global().parked_review_for_thread(tenant, thread_id).is_some()- })- {+ }) {tracing::warn!(thread_id = %thread_id,"[tool][plan_exit] a plan review is still parked on this thread — not flipping to build"diff --git a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rsindex 414dc9eccf..9dddfcfb9d 100644--- a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs+++ b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs@@ -22,7 +22,9 @@ async fn plan_exit_does_not_flip_while_a_review_is_parked() {tinyagents_harness::middleware::RunMode::Plan,);let gate = crate::plan_review::gate::global();- let tenant = crate::core::runtime::DispatchCtx::ambient().tenant().unwrap();+ let tenant = crate::core::runtime::DispatchCtx::ambient()+ .tenant()+ .unwrap();let parked = tokio::spawn(async move {gate.request_review(tenant,@@ -60,12 +62,13 @@ async fn plan_exit_does_not_flip_while_a_review_is_parked() {// Resolve the parked review so the spawned task and the gate's// bookkeeping don't leak past this test.assert!(- crate::plan_review::gate::global()- .decide_by_thread(- &crate::core::runtime::DispatchCtx::ambient().tenant().unwrap(),- thread_id,- PlanReviewResolution::Approve,- )+ crate::plan_review::gate::global().decide_by_thread(+ &crate::core::runtime::DispatchCtx::ambient()+ .tenant()+ .unwrap(),+ thread_id,+ PlanReviewResolution::Approve,+ ));let resolution = parked.await.unwrap();assert_eq!(resolution, PlanReviewResolution::Approve);diff --git a/crates/openhuman-core/src/agent_runs/context_breakdown.rs b/crates/openhuman-core/src/agent_runs/context_breakdown.rsindex bd2ad69665..63180dccd0 100644--- a/crates/openhuman-core/src/agent_runs/context_breakdown.rs+++ b/crates/openhuman-core/src/agent_runs/context_breakdown.rs@@ -14,9 +14,9 @@use std::collections::HashMap;use std::sync::Mutex;+use crate::core::runtime::Tenant;use once_cell::sync::Lazy;use serde::{Deserialize, Serialize};-use crate::core::runtime::Tenant;use crate::config::Config;use crate::core::Outcome;diff --git a/crates/openhuman-core/src/plan_review/gate_tests.rs b/crates/openhuman-core/src/plan_review/gate_tests.rsindex 3335ea5506..68ae1c4959 100644--- a/crates/openhuman-core/src/plan_review/gate_tests.rs+++ b/crates/openhuman-core/src/plan_review/gate_tests.rs@@ -31,12 +31,20 @@ async fn revise_carries_feedback_back() {let gate = std::sync::Arc::new(PlanReviewGate::new(Duration::from_secs(5)));let g2 = gate.clone();let parked = tokio::spawn(async move {- g2.request_review(tenant(), Some("t2".into()), None, "Plan".into(), vec![], None)- .await+ g2.request_review(+ tenant(),+ Some("t2".into()),+ None,+ "Plan".into(),+ vec![],+ None,+ )+ .await});tokio::time::sleep(Duration::from_millis(20)).await;assert!(gate.decide_by_thread(- &tenant(), "t2",+ &tenant(),+ "t2",PlanReviewResolution::Revise {feedback: "add a test step".into(),},@@ -53,7 +61,14 @@ async fn revise_carries_feedback_back() {async fn timeout_fails_closed_to_reject() {let gate = PlanReviewGate::new(Duration::from_millis(40));let resolution = gate- .request_review(tenant(), Some("t3".into()), None, "Plan".into(), vec![], None)+ .request_review(+ tenant(),+ Some("t3".into()),+ None,+ "Plan".into(),+ vec![],+ None,+ ).await;assert_eq!(resolution, PlanReviewResolution::Reject);// The waiter is cleaned up after timeout.@@ -73,8 +88,15 @@ async fn cancelled_park_cleans_up_waiter() {let gate = std::sync::Arc::new(PlanReviewGate::new(Duration::from_secs(30)));let g2 = gate.clone();let handle = tokio::spawn(async move {- g2.request_review(tenant(), Some("t-drop".into()), None, "Plan".into(), vec![], None)- .await+ g2.request_review(+ tenant(),+ Some("t-drop".into()),+ None,+ "Plan".into(),+ vec![],+ None,+ )+ .await});tokio::time::sleep(Duration::from_millis(20)).await;handle.abort();@@ -113,13 +135,19 @@ async fn parked_review_for_thread_carries_tool_call_id_and_expiry() {parked.await.unwrap();// Decided reviews are no longer parked.- assert!(gate.parked_review_for_thread(&tenant(), "t-replay").is_none());+ assert!(+ gate.parked_review_for_thread(&tenant(), "t-replay")+ .is_none()+ );}#[tokio::test]async fn parked_review_for_thread_is_none_when_nothing_is_parked() {let gate = PlanReviewGate::new(Duration::from_secs(5));- assert!(gate.parked_review_for_thread(&tenant(), "no-such-thread").is_none());+ assert!(+ gate.parked_review_for_thread(&tenant(), "no-such-thread")+ .is_none()+ );}#[tokio::test]@@ -153,7 +181,15 @@ async fn parked_reviews_are_isolated_by_tenant() {.parked_review_for_thread(&alice, "same-thread").expect("Alice's review is available in Alice's scope");assert!(gate.parked_review_for_thread(&bob, "same-thread").is_none());- assert!(!gate.decide(&bob, &alice_review.request_id, PlanReviewResolution::Approve));- assert!(gate.decide(&alice, &alice_review.request_id, PlanReviewResolution::Approve));+ assert!(!gate.decide(+ &bob,+ &alice_review.request_id,+ PlanReviewResolution::Approve+ ));+ assert!(gate.decide(+ &alice,+ &alice_review.request_id,+ PlanReviewResolution::Approve+ ));assert_eq!(parked.await.unwrap(), PlanReviewResolution::Approve);}diff --git a/crates/openhuman-core/src/plan_review/tool.rs b/crates/openhuman-core/src/plan_review/tool.rsindex 75dcbd3ac1..fe0edfcf21 100644--- a/crates/openhuman-core/src/plan_review/tool.rs+++ b/crates/openhuman-core/src/plan_review/tool.rs@@ -174,7 +174,8 @@ impl RequestPlanReviewTool {"[tool][request_plan_review] parking interactive turn for plan review");- let dispatch_ctx = crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(context);+ let dispatch_ctx =+ crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(context);let tenant = dispatch_ctx.tenant().map_err(|error| anyhow::anyhow!(error.to_string()))?;diff --git a/crates/openhuman-rpc/src/server/socketio.rs b/crates/openhuman-rpc/src/server/socketio.rsindex bb8830d55f..4efa0851c2 100644--- a/crates/openhuman-rpc/src/server/socketio.rs+++ b/crates/openhuman-rpc/src/server/socketio.rs@@ -1276,8 +1276,8 @@ fn replay_parked_plan_review(socket: &SocketRef, thread_id: &str) {let Ok(tenant) = crate::core_host::core::runtime::DispatchCtx::ambient().tenant() else {return;};- let Some(row) = crate::core_host::plan_review::gate::global()- .parked_review_for_thread(&tenant, thread_id)+ let Some(row) =+ crate::core_host::plan_review::gate::global().parked_review_for_thread(&tenant, thread_id)else {return;};