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
refactor(orchestration): reformat match arms for consistency
Steven Enamakelb4fcaee336ad
diff --git a/src/openhuman/agent/orchestration/agent_teams/runtime.rs b/src/openhuman/agent/orchestration/agent_teams/runtime.rsindex 4ceb3e6c39..48695f7d84 100644--- a/src/openhuman/agent/orchestration/agent_teams/runtime.rs+++ b/src/openhuman/agent/orchestration/agent_teams/runtime.rs@@ -306,13 +306,11 @@ async fn drive_member(| OrchestrationTaskStatus::Cancelled| OrchestrationTaskStatus::CancelRequested| OrchestrationTaskStatus::TimedOut- | OrchestrationTaskStatus::Abandoned => {- super::graph::MemberOutcome::Failed {- reason: snapshot- .error- .unwrap_or_else(|| "worker ended without completing".to_string()),- }- }+ | OrchestrationTaskStatus::Abandoned => super::graph::MemberOutcome::Failed {+ reason: snapshot+ .error+ .unwrap_or_else(|| "worker ended without completing".to_string()),+ },// `wait_agents` with no timeout only returns on terminal// status, so this is purely defensive — treat as a failure.other => super::graph::MemberOutcome::Failed {diff --git a/src/openhuman/agent/orchestration/ops.rs b/src/openhuman/agent/orchestration/ops.rsindex 5d91953867..dbc23a70bb 100644--- a/src/openhuman/agent/orchestration/ops.rs+++ b/src/openhuman/agent/orchestration/ops.rs@@ -537,7 +537,11 @@ fn mark_running(status_tx: &watch::Sender<ChildState>) {});}-fn snapshot_of(orchestration_id: &str, metadata: &ChildMetadata, state: &ChildState) -> AgentSnapshot {+fn snapshot_of(+ orchestration_id: &str,+ metadata: &ChildMetadata,+ state: &ChildState,+) -> AgentSnapshot {AgentSnapshot {orchestration_id: orchestration_id.to_string(),agent_id: metadata.agent_id.clone(),diff --git a/src/openhuman/agent/orchestration/ops_tests.rs b/src/openhuman/agent/orchestration/ops_tests.rsindex e473ab42de..9281767b18 100644--- a/src/openhuman/agent/orchestration/ops_tests.rs+++ b/src/openhuman/agent/orchestration/ops_tests.rs@@ -258,7 +258,7 @@ impl ChatModel<()> for ParallelCodingModel {#[test]fn unit_status_serializes_as_snake_case() {- let value = serde_json::to_value(AgentStatus::Completed).expect("serialize status");+ let value = serde_json::to_value(OrchestrationTaskStatus::Completed).expect("serialize status");assert_eq!(value, serde_json::json!("completed"));}@@ -295,7 +295,7 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {.await.expect("wait first child");let first_child = &first_wait.agents[0];- assert_eq!(first_child.status, AgentStatus::Completed);+ assert_eq!(first_child.status, OrchestrationTaskStatus::Completed);assert!(first_child.result_summary.as_deref()@@ -333,7 +333,7 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {final_child.parent_agent_id.as_deref(),Some(first.orchestration_id.as_str()));- assert_eq!(final_child.status, AgentStatus::Completed);+ assert_eq!(final_child.status, OrchestrationTaskStatus::Completed);assert!(final_child.result_summary.as_deref()@@ -406,7 +406,7 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {assert!(waited.agents.iter()- .all(|agent| agent.status == AgentStatus::Completed));+ .all(|agent| agent.status == OrchestrationTaskStatus::Completed));let outputs = waited.agents.iter()diff --git a/src/openhuman/agent/orchestration/workflow_runs/engine.rs b/src/openhuman/agent/orchestration/workflow_runs/engine.rsindex 1d9a7dec4e..95618270c3 100644--- a/src/openhuman/agent/orchestration/workflow_runs/engine.rs+++ b/src/openhuman/agent/orchestration/workflow_runs/engine.rs@@ -657,34 +657,30 @@ pub(super) async fn execute_phase(| OrchestrationTaskStatus::Cancelled| OrchestrationTaskStatus::CancelRequested| OrchestrationTaskStatus::TimedOut- | OrchestrationTaskStatus::Abandoned => {- PhaseWorkerOutcome {- orchestration_id: Some(oid),- output: None,- error: Some(format!(- "child '{}' (agent '{}') ended {}: {}",- s.orchestration_id,- s.agent_id,- serde_json::to_value(s.status)- .ok()- .and_then(|v| v.as_str().map(str::to_string))- .unwrap_or_else(|| "non-completed".to_string()),- s.error.clone().unwrap_or_default()- )),- }- }+ | OrchestrationTaskStatus::Abandoned => PhaseWorkerOutcome {+ orchestration_id: Some(oid),+ output: None,+ error: Some(format!(+ "child '{}' (agent '{}') ended {}: {}",+ s.orchestration_id,+ s.agent_id,+ serde_json::to_value(s.status)+ .ok()+ .and_then(|v| v.as_str().map(str::to_string))+ .unwrap_or_else(|| "non-completed".to_string()),+ s.error.clone().unwrap_or_default()+ )),+ },OrchestrationTaskStatus::Pending| OrchestrationTaskStatus::Running- | OrchestrationTaskStatus::Awaiting => {- PhaseWorkerOutcome {- orchestration_id: Some(oid),- output: None,- error: Some(format!(- "child '{}' returned non-terminal status",- s.orchestration_id- )),- }- }+ | OrchestrationTaskStatus::Awaiting => PhaseWorkerOutcome {+ orchestration_id: Some(oid),+ output: None,+ error: Some(format!(+ "child '{}' returned non-terminal status",+ s.orchestration_id+ )),+ },},None => PhaseWorkerOutcome {orchestration_id: Some(oid),