Skip to content

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

chore: reorder imports across subagent orchestration files

Steven Enamakel3068ef3868ec
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
index 33516a3d04..1f6d1cf2c3 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
@@ -65,7 +65,8 @@ const REGISTRY_SOFT_CAP: usize = 256;
static REGISTRY: OnceLock<DetachedTaskRegistry<RunningSubagentMetadata, DetachedSubagentStatus>> =
OnceLock::new();
-pub(crate) fn registry() -> &'static DetachedTaskRegistry<RunningSubagentMetadata, DetachedSubagentStatus> {
+pub(crate) fn registry(
+) -> &'static DetachedTaskRegistry<RunningSubagentMetadata, DetachedSubagentStatus> {
REGISTRY.get_or_init(|| {
DetachedTaskRegistry::new(
shared_steering_registry().clone(),
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
index 3ca2fee342..9cb34b70dc 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
@@ -6,8 +6,9 @@
use std::path::Path;
use tinyagents_orchestration::subagent::{
- resume_ref_for_task as live_resume_ref, resume_ref_from_record, task_id_for_session as live_task_id,
- task_id_for_session_in_records, SubagentResumeRef, WaitError,
+ resume_ref_for_task as live_resume_ref, resume_ref_from_record,
+ task_id_for_session as live_task_id, task_id_for_session_in_records, SubagentResumeRef,
+ WaitError,
};
use super::registry::registry;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs
index 36b324ac6e..55d6eaa044 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs
@@ -17,9 +17,9 @@ use tinyagents_graph::orchestration::{
OrchestrationTaskFilter, OrchestrationTaskRecord, TaskStore, TaskStoreRegistry,
};
use tinyagents_orchestration::subagent::{
- list_subagent_records, orphaned_subagent_reason, record_agent_id, record_cancelled as ledger_cancelled,
- record_parent_session, record_spawned as ledger_spawned, subagent_record_for_task,
- task_status_label, SpawnedSubagent, WaitError,
+ list_subagent_records, orphaned_subagent_reason, record_agent_id,
+ record_cancelled as ledger_cancelled, record_parent_session, record_spawned as ledger_spawned,
+ subagent_record_for_task, task_status_label, SpawnedSubagent, WaitError,
};
/// Where a workspace's detached-task ledger lives.
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
index 4442752798..3ca094720f 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
@@ -1,7 +1,5 @@
-use tinyagents_orchestration::subagent::FinishedOutcome;
use super::*;
use crate::agent::orchestration::fleet_tools::FleetToolSet;
-use tinyagents_orchestration::subagent::{DetachedSubagentStatus, WaitError, DETACHED_LEDGER_TIMEOUT_MS};
use crate::agent::orchestration::running_subagents::resolve::resume_ref_for_task;
use crate::agent::orchestration::running_subagents::resolve::task_id_for_session;
use crate::agent::orchestration::running_subagents::roster::snapshot_for_parent;
@@ -23,6 +21,10 @@ use tinyagents_harness::run_queue::{QueueLane, RunQueue};
use tinyagents_harness::steering::{
SteeringCommand, SteeringCommandKind, SteeringHandle, SteeringPolicy,
};
+use tinyagents_orchestration::subagent::FinishedOutcome;
+use tinyagents_orchestration::subagent::{
+ DetachedSubagentStatus, WaitError, WaitOutcome, DETACHED_LEDGER_TIMEOUT_MS,
+};
use tokio::sync::watch;
use tokio::task::AbortHandle;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_wire_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_wire_tests.rs
index bbfea3183e..f5dde69d16 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_wire_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_wire_tests.rs
@@ -4,14 +4,14 @@
//! the bytes; they must not change when the generic logic moves upstream.
use super::*;
-use tinyagents_orchestration::subagent::WaitError;
-use tinyagents_orchestration::subagent::FinishedOutcome;
use crate::agent::orchestration::running_subagents::roster::snapshot_for_parent;
use crate::agent::orchestration::running_subagents::task_ledger::task_store_for_workspace;
use tinyagents_graph::orchestration::{
OrchestrationTaskKind, OrchestrationTaskResult, OrchestrationTaskSpec,
};
use tinyagents_harness::ids::TaskId;
+use tinyagents_orchestration::subagent::FinishedOutcome;
+use tinyagents_orchestration::subagent::WaitError;
fn spec(id: &str, parent: &str, session: Option<&str>) -> OrchestrationTaskSpec {
let mut spec = OrchestrationTaskSpec::new(
@@ -61,7 +61,9 @@ async fn roster_status_labels_are_literal() {
question: "q".into(),
})
.unwrap(),
- "wire-fail" => tx.send(DetachedSubagentStatus::Failed { error: "e".into() }).unwrap(),
+ "wire-fail" => tx
+ .send(DetachedSubagentStatus::Failed { error: "e".into() })
+ .unwrap(),
_ => {}
}
}
@@ -205,8 +207,12 @@ fn reconcile_reason_and_resume_labels_are_literal() {
store
.insert(spec("wire-orphan-cancel", "wire-orphan-parent", None))
.unwrap();
- store.mark_running(&TaskId::new("wire-orphan-cancel")).unwrap();
- store.request_cancel(&TaskId::new("wire-orphan-cancel")).unwrap();
+ store
+ .mark_running(&TaskId::new("wire-orphan-cancel"))
+ .unwrap();
+ store
+ .request_cancel(&TaskId::new("wire-orphan-cancel"))
+ .unwrap();
assert_eq!(reconcile_orphaned_tasks_on_boot(ws.path()), 2);
let failed = store.get(&TaskId::new("wire-orphan-run")).unwrap();
assert_eq!(
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
index 14727b143e..fcf40a785a 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
@@ -57,10 +57,10 @@ fn field(out: &Value, name: &str) -> Option<Value> {
#[tokio::test]
async fn cancel_of_a_finished_run_reports_its_outcome_and_rewrites_nothing() {
use crate::agent::orchestration::running_subagents::{register, status_channel};
- use tinyagents_orchestration::subagent::DetachedSubagentStatus;
use crate::agent::orchestration::subagent_sessions::SubagentSessionStore;
use std::sync::Arc;
use tinyagents_harness::run_queue::RunQueue;
+ use tinyagents_orchestration::subagent::DetachedSubagentStatus;
let _lock = crate::config::TEST_ENV_LOCK
.lock()
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
index 3891c3d464..3bd01de776 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
@@ -9,7 +9,6 @@ use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::messages::ChatMessage;
use crate::agent::orchestration::fleet_tools::FleetToolSet;
use crate::agent::orchestration::running_subagents;
-use tinyagents_orchestration::subagent::DetachedSubagentStatus;
use crate::agent::orchestration::subagent_sessions::{
self, DurableSubagentStatus, SubagentSessionSelector, SubagentSessionStore,
SubagentSessionUpsert,
@@ -25,6 +24,7 @@ use std::sync::Arc;
use tinyagents_harness::context::{RunConfig, RunContext};
use tinyagents_harness::run_queue::RunQueue;
use tinyagents_harness::tool::{ToolDispatch, ToolExecutionContext};
+use tinyagents_orchestration::subagent::DetachedSubagentStatus;
use tinytools::ToolRunContext;
use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rs
index da2c996343..09ff6febce 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rs
@@ -9,14 +9,14 @@ use std::time::Duration;
use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::orchestration::running_subagents;
-use tinyagents_orchestration::subagent::{
- DetachedSubagentStatus, SubagentResumeRef, WaitError, WaitOutcome,
-};
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
use tinyagents_harness::context::RunContext;
use tinyagents_harness::tool::{ToolDispatch, ToolExecutionContext};
+use tinyagents_orchestration::subagent::{
+ DetachedSubagentStatus, SubagentResumeRef, WaitError, WaitOutcome,
+};
use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};
const DEFAULT_TIMEOUT_SECS: u64 = 120;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent_tests.rs
index ff6fec98a3..626697542c 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent_tests.rs
@@ -29,7 +29,7 @@ async fn outside_agent_turn_is_rejected() {
#[test]
fn running_wait_message_includes_agent_id_and_tick_instruction() {
- let reference = running_subagents::SubagentResumeRef {
+ let reference = tinyagents_orchestration::subagent::SubagentResumeRef {
task_id: "sub-1".into(),
agent_id: "researcher".into(),
subagent_session_id: Some("subsess-1".into()),