Skip to content

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

style: apply rustfmt formatting to subagent host lifecycle code

Steven Enamakel63ecef2e4a31
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle/driver_adapter.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle/driver_adapter.rs
index 234056bafa..23bdfa437b 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle/driver_adapter.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle/driver_adapter.rs
@@ -401,9 +401,9 @@ pub(in crate::agent::subagent_host) fn outcome_to_host(
.charged_amount
.map(|amount| amount.micros as f64 / 1_000_000.0)
.unwrap_or_default(),
- cost_source: outcome.cost_source.unwrap_or_else(|| {
- cost_source_of(outcome.usage.usage.charged_amount.as_ref())
- }),
+ cost_source: outcome
+ .cost_source
+ .unwrap_or_else(|| cost_source_of(outcome.usage.usage.charged_amount.as_ref())),
},
artifact_paths: outcome
.artifacts
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle/persistence.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle/persistence.rs
index 2c215b4c24..4b7549b80d 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle/persistence.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle/persistence.rs
@@ -216,12 +216,17 @@ impl OpenHumanPersistence {
agent_id: metadata
.get("agent_id")
.cloned()
- .or_else(|| host.get("agent_id").and_then(serde_json::Value::as_str).map(str::to_owned))
+ .or_else(|| {
+ host.get("agent_id")
+ .and_then(serde_json::Value::as_str)
+ .map(str::to_owned)
+ })
.unwrap_or_default(),
- worker_thread_id: metadata
- .get("worker_thread_id")
- .cloned()
- .or_else(|| host.get("worker_thread_id").and_then(serde_json::Value::as_str).map(str::to_owned)),
+ worker_thread_id: metadata.get("worker_thread_id").cloned().or_else(|| {
+ host.get("worker_thread_id")
+ .and_then(serde_json::Value::as_str)
+ .map(str::to_owned)
+ }),
history: outcome
.history
.iter()
@@ -263,9 +268,7 @@ impl OpenHumanPersistence {
.cloned()
.and_then(|value| serde_json::from_value(value).ok())
})
- .unwrap_or_else(|| {
- cost_source_of(outcome.usage.usage.charged_amount.as_ref())
- }),
+ .unwrap_or_else(|| cost_source_of(outcome.usage.usage.charged_amount.as_ref())),
},
artifact_paths: outcome
.artifacts
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
index 58090a1a60..6cc052a55a 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
@@ -510,10 +510,9 @@ async fn legacy_pause_migration_preserves_host_checkpoint_metadata_and_bytes() {
newer_key.task_id = "task-with-new-resume-metadata".into();
newer_checkpoint.task_key = Some(newer_key.clone());
newer_checkpoint.task_id = newer_key.task_id.clone();
- newer_checkpoint.resume_metadata.insert(
- "skill_filter_override".into(),
- "new-skill".into(),
- );
+ newer_checkpoint
+ .resume_metadata
+ .insert("skill_filter_override".into(), "new-skill".into());
newer_checkpoint
.resume_metadata
.insert("model_override".into(), "new-model".into());
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
index 5fba6598a0..212e9e7022 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
@@ -139,12 +139,9 @@ async fn independent_host_bundles_share_and_project_the_persisted_winner() {
let leader_definition = definition.clone();
let leader_options = options.clone();
let leader = tokio::spawn(async move {
- crate::agent::subagent_host::OpenHumanSubagentHost::new(
- leader_definition,
- leader_options,
- )
- .run(&leader_parent, "produce a report".into())
- .await
+ crate::agent::subagent_host::OpenHumanSubagentHost::new(leader_definition, leader_options)
+ .run(&leader_parent, "produce a report".into())
+ .await
});
tokio::time::timeout(std::time::Duration::from_secs(5), started_rx.recv())
.await
@@ -162,9 +159,9 @@ async fn independent_host_bundles_share_and_project_the_persisted_winner() {
.await
});
let mut cancelled_parent = cancelled_context.into_tinyagents(
- tinyagents_harness::context::RunConfig::new("cross-bundle-parent")
- .with_thread("cross-bundle-thread"),
- );
+ tinyagents_harness::context::RunConfig::new("cross-bundle-parent")
+ .with_thread("cross-bundle-thread"),
+ );
let observer_cancellation = tinyagents_harness::CancellationToken::new();
cancelled_parent.cancellation = observer_cancellation.clone();
let cancelled_definition = make_def_named_tools(&["blocking_cross_bundle_fixture"]);
@@ -225,7 +222,10 @@ async fn independent_host_bundles_share_and_project_the_persisted_winner() {
serde_json::to_value(&follower.final_history).unwrap(),
"follower receives the full winner history"
);
- assert!(!leader.final_history.is_empty(), "winner history is preserved");
+ assert!(
+ !leader.final_history.is_empty(),
+ "winner history is preserved"
+ );
assert_eq!(leader.usage.input_tokens, follower.usage.input_tokens);
assert!(leader.usage.input_tokens > 0, "winner usage is preserved");
assert_eq!(leader.artifact_paths, follower.artifact_paths);