Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(orchestration): remove shared progress sink and replace custom status enum

Steven Enamakel19becf858a36
diff --git a/src/openhuman/agent/orchestration/ops.rs b/src/openhuman/agent/orchestration/ops.rs
index 5e87d61619..5d91953867 100644
--- a/src/openhuman/agent/orchestration/ops.rs
+++ b/src/openhuman/agent/orchestration/ops.rs
@@ -119,7 +119,6 @@ type ChildRegistry = DetachedTaskRegistry<ChildMetadata, ChildState>;
pub struct AgentOrchestrationSession {
session_id: String,
registry: Arc<ChildRegistry>,
- progress_sink: Arc<std::sync::Mutex<Option<mpsc::Sender<AgentProgress>>>>,
}
impl AgentOrchestrationSession {
@@ -137,7 +136,6 @@ impl AgentOrchestrationSession {
REGISTRY_SOFT_CAP,
ChildState::is_terminal,
)),
- progress_sink: Arc::new(std::sync::Mutex::new(None)),
}
}
@@ -336,10 +334,8 @@ impl AgentOrchestrationSession {
parent_agent_id: request.parent_agent_id,
});
- if let Some(progress) = parent.on_progress.clone() {
- if let Ok(mut sink) = self.progress_sink.lock() {
- sink.get_or_insert(progress.clone());
- }
+ let progress_sink = parent.on_progress.clone();
+ if let Some(progress) = progress_sink.clone() {
let resolved_display_name = AgentDefinitionRegistry::global()
.and_then(|reg| reg.get(&agent_id))
.map(|def| def.display_name().to_string());
@@ -408,7 +404,13 @@ impl AgentOrchestrationSession {
})
.await;
session
- .finish_agent(&task_id, &task_agent_id, &task_status_tx, result)
+ .finish_agent(
+ &task_id,
+ &task_agent_id,
+ &task_status_tx,
+ progress_sink,
+ result,
+ )
.await;
}),
));
@@ -446,6 +448,7 @@ impl AgentOrchestrationSession {
orchestration_id: &str,
agent_id: &str,
status_tx: &watch::Sender<ChildState>,
+ progress_sink: Option<mpsc::Sender<AgentProgress>>,
result: Result<SubagentRunOutcome, crate::openhuman::agent::harness::SubagentRunError>,
) {
// A cancelled child has already reached a terminal status via
@@ -454,12 +457,6 @@ impl AgentOrchestrationSession {
return;
}
- let progress_sink = self
- .progress_sink
- .lock()
- .ok()
- .and_then(|sink| sink.clone());
-
match result {
Ok(outcome) => {
let _ = status_tx.send(ChildState {
diff --git a/src/openhuman/agent/orchestration/types.rs b/src/openhuman/agent/orchestration/types.rs
index 909c8b3272..df432f2f86 100644
--- a/src/openhuman/agent/orchestration/types.rs
+++ b/src/openhuman/agent/orchestration/types.rs
@@ -1,29 +1,15 @@
//! Public data model for high-level agent orchestration.
+//!
+//! The status vocabulary is TinyAgents'
+//! [`OrchestrationTaskStatus`] — the host's own `AgentStatus` copy was retired
+//! once the control plane moved onto the crate's `DetachedTaskRegistry`. It
+//! never appeared on a JSON-RPC schema, and the detached sub-agent path was
+//! already reporting the crate enum, so the two vocabularies are now one.
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
-/// Stable status vocabulary for parent/child orchestration.
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
-#[serde(rename_all = "snake_case")]
-pub enum AgentStatus {
- Pending,
- Running,
- Waiting,
- Completed,
- Failed,
- Cancelled,
- Closed,
-}
-
-impl AgentStatus {
- pub fn is_terminal(self) -> bool {
- matches!(
- self,
- Self::Completed | Self::Failed | Self::Cancelled | Self::Closed
- )
- }
-}
+pub use tinyagents::graph::orchestration::OrchestrationTaskStatus;
/// Request to spawn a child agent from the current parent agent turn.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
@@ -47,7 +33,7 @@ pub struct SpawnAgentRequest {
pub struct SpawnAgentResponse {
pub orchestration_id: String,
pub agent_id: String,
- pub status: AgentStatus,
+ pub status: OrchestrationTaskStatus,
}
/// Wait request for one or more children.
@@ -71,7 +57,7 @@ pub struct AgentSnapshot {
pub orchestration_id: String,
pub agent_id: String,
pub parent_agent_id: Option<String>,
- pub status: AgentStatus,
+ pub status: OrchestrationTaskStatus,
pub prompt: String,
pub result_summary: Option<String>,
pub error: Option<String>,