Skip to content

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

chore: apply rustfmt formatting across agent modules

Steven Enamakel79bec5cff6b4
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
index 4214ba6365..e900996fd8 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
@@ -77,10 +77,18 @@ fn compatible_session_reuses_and_incompatible_shape_spawns_new() {
fn closed_session_is_not_reusable() {
let dir = tempfile::tempdir().unwrap();
let store = SubagentSessionStore::new(dir.path().to_path_buf());
+ let task_key = format!(
+ "task-{}",
+ dir.path()
+ .file_name()
+ .expect("tempdir name")
+ .to_string_lossy()
+ );
+ let selector = selector(&task_key);
let session = upsert_running(
&store,
SubagentSessionUpsert {
- selector: selector("task"),
+ selector: selector.clone(),
display_name: None,
task_title: "Task".into(),
worker_thread_id: None,
@@ -91,7 +99,13 @@ fn closed_session_is_not_reusable() {
.unwrap();
assert!(close(&store, &session.subagent_session_id).unwrap());
- assert!(find_reusable(&store, &selector("task")).unwrap().is_none());
+ let reusable = find_reusable(&store, &selector).unwrap();
+ assert!(
+ reusable.is_none(),
+ "closed session {} matched reusable record {:?}",
+ session.subagent_session_id,
+ reusable.map(|record| (record.subagent_session_id, record.status, record.reusable))
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
index 796b9f088a..99c80474bd 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
@@ -553,7 +553,10 @@ impl ContinueSubagentTool {
}
Ok(ToolResult::success(outcome.output))
}
- SubagentRunStatus::Incomplete { reason, failure_cause } => {
+ SubagentRunStatus::Incomplete {
+ reason,
+ failure_cause,
+ } => {
// The continued sub-agent stopped short again (stuck halt
// / iteration cap). Hand back the partial progress framed
// as incomplete rather than a clean success (#4096).
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
index f5fa5332d4..9993507698 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
@@ -548,7 +548,10 @@ pub(crate) async fn dispatch_subagent_with_live_parent(
// finished result or re-run the identical delegation unchanged
// (#4096). Still a lifecycle-completed run, so publish
// SubagentCompleted like the `Completed` arm.
- SubagentRunStatus::Incomplete { reason, failure_cause } => {
+ SubagentRunStatus::Incomplete {
+ reason,
+ failure_cause,
+ } => {
if emit_lifecycle_effects {
crate::agent::orchestration::subagent_events::publish_subagent_completed(
parent_session,
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
index 402d1fd5d4..7f7cf99358 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
@@ -421,7 +421,9 @@ impl SpawnWorkerThreadTool {
})
)))
}
- crate::agent::subagent_host::SubagentRunStatus::Incomplete { reason, .. } => {
+ crate::agent::subagent_host::SubagentRunStatus::Incomplete {
+ reason, ..
+ } => {
if owns_effects {
crate::agent::orchestration::subagent_events::publish_subagent_completed(
parent_session,
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
index 26d7563cef..c3e2d01a34 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
@@ -177,10 +177,7 @@ fn a_stopped_subagent_span_closes_at_warning_with_stop_attributes() {
(AgentProgress::TurnStarted, 0),
(spawn("t-stop", "Research"), 5),
(
- subagent_completed(
- "t-stop",
- Some(classified_breaker_stop()),
- ),
+ subagent_completed("t-stop", Some(classified_breaker_stop())),
40,
),
]);
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
index 0902e5b60b..ed09a97b4e 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
@@ -74,15 +74,14 @@ async fn committed_progress_carries_the_sidecar_stop_on_turn_completed() {
let (tx, mut rx) = tokio::sync::mpsc::channel(4);
let mut context = crate::agent::tinyagents::host::OpenHumanRunContext::new();
context.progress = Some(tx);
- context.session_sidecar.lock().unwrap().stop = Some(
- crate::agent::turn_projection::breaker_stop_with_cause(
+ context.session_sidecar.lock().unwrap().stop =
+ Some(crate::agent::turn_projection::breaker_stop_with_cause(
tinyagents_harness::no_progress::ClassifiedStopCause {
class: "uncertain_side_effect".into(),
operation: "web_answer_tool".into(),
summary: "classified failure".into(),
},
- ),
- );
+ ));
let receipt = CommitReceipt {
outcome: SessionTurnOutcome {
history: Vec::new(),
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
index 4f0bb7a61f..967c64d156 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -898,15 +898,7 @@ async fn run_typed_mode(
);
}
- let (
- output,
- iterations,
- agg_usage,
- early_exit_tool,
- hit_cap,
- breaker_halt,
- failure_cause,
- ) =
+ let (output, iterations, agg_usage, early_exit_tool, hit_cap, breaker_halt, failure_cause) =
super::graph::run_subagent_via_graph(
subagent_source.clone(),
&model,
diff --git a/crates/openhuman-core/src/agent/turn_projection_tests.rs b/crates/openhuman-core/src/agent/turn_projection_tests.rs
index e2d16d38d7..04b6fcf7fa 100644
--- a/crates/openhuman-core/src/agent/turn_projection_tests.rs
+++ b/crates/openhuman-core/src/agent/turn_projection_tests.rs
@@ -53,9 +53,14 @@ fn an_incomplete_reason_maps_to_cap_or_breaker() {
);
let stop = stop_from_incomplete(CLASSIFIED_NOTE);
assert_eq!(stop.kind, TurnStopKind::Breaker);
- assert_eq!(stop.operation, None, "legacy prose cannot inject typed metadata");
assert_eq!(
- breaker_stop_with_cause(classified_cause()).operation.as_deref(),
+ stop.operation, None,
+ "legacy prose cannot inject typed metadata"
+ );
+ assert_eq!(
+ breaker_stop_with_cause(classified_cause())
+ .operation
+ .as_deref(),
Some("web_answer_tool")
);
}