Skip to content

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

chore(orchestration): apply rustfmt import ordering and line wrapping

Steven Enamakelc8c7bba3e918
diff --git a/crates/openhuman-core/src/agent/orchestration/README.md b/crates/openhuman-core/src/agent/orchestration/README.md
index a167965c7c..3ca9eb2d09 100644
--- a/crates/openhuman-core/src/agent/orchestration/README.md
+++ b/crates/openhuman-core/src/agent/orchestration/README.md
@@ -37,7 +37,9 @@ RPC/tool formatting, and OpenHuman's worktree policy.
from the global bus regardless of the parent turn's lifecycle
(`running_subagents*.rs`, [`background_completions.rs`](./background_completions.rs),
[`completion_notice.rs`](./completion_notice.rs),
- [`background_delivery.rs`](./background_delivery.rs), [`run_ledger_finalize.rs`](./run_ledger_finalize.rs)). The delivery turn runs
+ [`background_delivery.rs`](./background_delivery.rs)). The AgentRun status projection lives in
+ [`agent_runs/subagent_finalize.rs`](../../agent_runs/subagent_finalize.rs), because it updates the
+ product run ledger separately from TinyAgents' orchestration task store. The delivery turn runs
on the originating thread's cached chat session via
`web_chat::run_system_turn_on_thread`, never on a throwaway host.
- A shared root `ParentExecutionContext` builder for surfaces that spawn real
@@ -97,9 +99,8 @@ RPC/tool formatting, and OpenHuman's worktree policy.
`[BACKGROUND_DELIVERY_FAILED]` give-up notice. `background_delivery.rs` keeps
the host policy: idle-gated, debounced (3s), batched delivery of finished
background runs back into chat, the system turn, and the give-up writer fed by
- `mark_failed`. `run_ledger_finalize.rs` is the
- global-bus subscriber that settles ledger rows for runs that outlive their
- spawning turn.
+ `mark_failed`. The `agent_runs` domain subscribes to terminal sub-agent events
+ to settle its ledger for runs that outlive their spawning turn.
- [`fleet_tools.rs`](./fleet_tools.rs): decides which fleet-control tools (`wait_subagent`,
`steer_subagent`, `wait_loop`, `close_subagent`) a given parent agent's
definition actually exposes, so the delegation prompts and the
@@ -172,7 +173,7 @@ races it against the inherited cancellation token. Execution itself routes throu
`{workspace}/session_db/sessions.db` (see [`sessions/mod.rs`](../../sessions/mod.rs)). Every
spawn path (`spawn_subagent`, `spawn_async_subagent`,
`spawn_parallel_agents`, `continue_subagent`, `dispatch`) writes a `running`
- `agent_runs` row; `run_ledger_finalize.rs` settles it from the global event
+ `agent_runs` row; the `agent_runs` domain settles it from the global event
bus so detached runs that outlive their spawning turn are not left `running`
forever.
- `subagent_sessions/`: `SubagentSessionStore` writes
@@ -209,7 +210,7 @@ what the harness exposes to the child.
- `core::bus::BUS`: `DomainEvent::AgentOrchestration*` /
`Subagent*` publication and subscription.
- `web_chat::progress_bridge`: the per-turn progress-channel counterpart to
- `run_ledger_finalize.rs`'s global-bus settlement.
+ `agent_runs::subagent_finalize`'s global-bus settlement.
## Used by
diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs
index 339a1c1047..b7ed09ddb9 100644
--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs
+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs
@@ -29,7 +29,7 @@
use std::sync::Arc;
-use anyhow::{anyhow, Result};
+use anyhow::{Result, anyhow};
use serde_json::json;
use crate::agent::harness::ParentExecutionContext;
@@ -46,8 +46,8 @@ use {
};
use tinyagents_orchestration::teams::{
- build_member_prompt, claimable_task, deliver_pending_messages, run_member_graph,
- truncate_chars, MemberOutcome, SessionTeamLedger, TeamError,
+ MemberOutcome, SessionTeamLedger, TeamError, build_member_prompt, claimable_task,
+ deliver_pending_messages, run_member_graph, truncate_chars,
};
use tinyagents_graph::GraphTracingSink;
@@ -501,7 +501,7 @@ async fn record_failure_event(
mod run_ledger {
use std::path::Path;
- use anyhow::{anyhow, Result};
+ use anyhow::{Result, anyhow};
use super::{AgentTeamMember, AgentTeamTask, ClaimOutcome, CompletionOutcome, RunEventAppend};
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs
index b6f6986a4e..045b7687dd 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs
@@ -97,7 +97,7 @@ async fn one_profiles_stop_and_delete_never_reach_anothers_thread() {
#[test]
fn a_saas_cancel_reaches_only_the_callers_workspace() {
- use super::running_subagents::{caller_workspace_in, CallerWorkspace};
+ use super::running_subagents::{CallerWorkspace, caller_workspace_in};
let ws = TestWorkspace::new();
let alice = profile("u-alice", ws.path());
assert!(matches!(
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs
index c72e47df3c..a36f17ce61 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs
@@ -9,7 +9,7 @@ use std::path::Path;
use std::sync::Arc;
use super::background_completions::*;
-use super::background_delivery::{drain_schedule_in, Drain};
+use super::background_delivery::{Drain, drain_schedule_in};
use crate::core::events::DomainEvent;
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
use crate::tools::toolpacks::ToolGroups;
@@ -151,7 +151,7 @@ fn an_unknown_session_is_dropped_in_saas() {
/// its own marks.
#[tokio::test]
async fn busy_marks_are_keyed_by_the_explicit_context() {
- use super::busy_guard::{clear_busy_for_thread, is_busy, TurnBusy};
+ use super::busy_guard::{TurnBusy, clear_busy_for_thread, is_busy};
let _guard = crate::config::TEST_ENV_LOCK.lock().await;
let (ws_a, ws_b) = (TestWorkspace::new(), TestWorkspace::new());
let alice = DispatchCtx::new(profile(&unique("b-alice"), ws_a.path()));
diff --git a/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs b/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs
index f42594160d..bb81a8bda4 100644
--- a/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs
@@ -1,7 +1,7 @@
use std::path::Path;
use std::sync::Arc;
-use super::super::background_completions::{new_router, state, Entry};
+use super::super::background_completions::{Entry, new_router, state};
use tinyagents_tasks::CompletionStore;
/// A temporary workspace that forgets its router when dropped, so the
diff --git a/crates/openhuman-core/src/agent/orchestration/delegation.rs b/crates/openhuman-core/src/agent/orchestration/delegation.rs
index 45da5d8675..6792108ff5 100644
--- a/crates/openhuman-core/src/agent/orchestration/delegation.rs
+++ b/crates/openhuman-core/src/agent/orchestration/delegation.rs
@@ -12,7 +12,7 @@
use std::sync::Arc;
use crate::agent::subagent_host::{
- run_subagent_via_driver_tool, SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, run_subagent_via_driver_tool,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::agent_registry::host_definition::AgentDefinition;
diff --git a/crates/openhuman-core/src/agent/orchestration/ops.rs b/crates/openhuman-core/src/agent/orchestration/ops.rs
index 4a2ddcccaf..3bae647345 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops.rs
@@ -27,7 +27,7 @@ use super::types::{
};
use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::subagent_host::{
- run_subagent, SubagentRunError, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
+ SubagentRunError, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent,
};
use crate::agent::tinyagents::host::steering::shared_steering_registry;
use crate::agent_registry::host_definition::{AgentDefinition, AgentDefinitionRegistry};
@@ -37,8 +37,8 @@ use crate::progress::AgentProgress;
use std::collections::BTreeMap;
use std::sync::Arc;
use thiserror::Error;
-use tinyagents_harness::ids::TaskId;
use tinyagents_harness::CancellationToken;
+use tinyagents_harness::ids::TaskId;
use tinyagents_tasks::{
DetachedTaskRegistry, DetachedTaskRegistryError, DetachedTaskWaitOutcome,
OrchestrationTaskStatus,
diff --git a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
index aa437055ce..c15f6c0591 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
@@ -6,8 +6,8 @@ use async_trait::async_trait;
use parking_lot::Mutex;
use std::future::Future;
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use tinyagents_tasks::OrchestrationTaskStatus;
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
@@ -241,11 +241,13 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
.expect("wait first child");
let first_child = &first_wait.agents[0];
assert_eq!(first_child.status, OrchestrationTaskStatus::Completed);
- assert!(first_child
- .result_summary
- .as_deref()
- .unwrap_or_default()
- .contains("CODE_AGENT_QUESTION"));
+ assert!(
+ first_child
+ .result_summary
+ .as_deref()
+ .unwrap_or_default()
+ .contains("CODE_AGENT_QUESTION")
+ );
// `message_agent`/`follow_up` are gone (superseded by the durable verbs in
// `command_center::control`). The orchestrator now records its answer by
@@ -283,11 +285,13 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
Some(first.orchestration_id.as_str())
);
assert_eq!(final_child.status, OrchestrationTaskStatus::Completed);
- assert!(final_child
- .result_summary
- .as_deref()
- .unwrap_or_default()
- .contains("CODE_AGENT_DONE"));
+ assert!(
+ final_child
+ .result_summary
+ .as_deref()
+ .unwrap_or_default()
+ .contains("CODE_AGENT_DONE")
+ );
let prompts = provider.prompts();
assert_eq!(prompts.len(), 2);
@@ -361,10 +365,12 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {
assert!(waited.completed);
assert_eq!(waited.agents.len(), 3);
- assert!(waited
- .agents
- .iter()
- .all(|agent| agent.status == OrchestrationTaskStatus::Completed));
+ assert!(
+ waited
+ .agents
+ .iter()
+ .all(|agent| agent.status == OrchestrationTaskStatus::Completed)
+ );
let outputs = waited
.agents
.iter()
diff --git a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs
index 004d8e2063..a63e1f24a7 100644
--- a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs
+++ b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs
@@ -28,8 +28,8 @@ use std::sync::Arc;
use anyhow::{Context, Result};
-use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::OpenHumanSessionHost;
+use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::config::Config;
const LOG_TARGET: &str = "agent_orchestration::parent_context";
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
index bd441aaae5..a2ec8585d1 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
@@ -67,14 +67,14 @@ pub(crate) use cancel::cancel_by_task;
#[cfg(test)]
pub(crate) use cancel::prune;
#[cfg(test)]
-pub(crate) use cancel::{caller_workspace_in, CallerWorkspace};
+pub(crate) use cancel::{CallerWorkspace, caller_workspace_in};
pub(crate) use cancel::{
- cancel_all, cancel_by_session_in_workspace, cancel_by_task_with_workspace_reason,
- cancel_for_thread, stop_for_thread, CancelledSubagent,
+ CancelledSubagent, cancel_all, cancel_by_session_in_workspace,
+ cancel_by_task_with_workspace_reason, cancel_for_thread, stop_for_thread,
};
pub(crate) use registry::admit_spawn;
#[cfg(test)]
-pub(crate) use registry::{register, status_channel, RegistrationError};
+pub(crate) use registry::{RegistrationError, register, status_channel};
pub(crate) use roster::active_subagents_context_block;
#[cfg(test)]
pub(crate) use steering::steer;
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 edbb8e5326..c0d2a4c25f 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
@@ -28,14 +28,14 @@ use tokio::sync::watch;
use tokio::task::AbortHandle;
use crate::agent::tinyagents::host::steering::shared_steering_registry;
+use tinyagents_harness::CancellationToken;
use tinyagents_harness::ids::TaskId;
use tinyagents_harness::run_queue::RunQueue;
-use tinyagents_harness::CancellationToken;
use tinyagents_tasks::DetachedTaskRegistry;
use super::task_ledger::{record_spawned, task_store_for_workspace};
use tinyagents_orchestration::subagent::{
- spawn_status_watcher, DetachedSubagentStatus, SubagentIdentity, WaitError,
+ DetachedSubagentStatus, SubagentIdentity, WaitError, spawn_status_watcher,
};
#[derive(Clone)]
@@ -138,8 +138,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/roster.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/roster.rs
index 6d3ad37e94..65a69b7f4f 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/roster.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/roster.rs
@@ -1,7 +1,7 @@
//! Read-only rosters over the sub-agent registry: the durable+live merge used to render the
//! `[active_subagents]` context block.
-use tinyagents_orchestration::subagent::{snapshot_for_owner, SubagentSnapshot};
+use tinyagents_orchestration::subagent::{SubagentSnapshot, snapshot_for_owner};
use super::registry::{admit_workspace, owner_key, registry};
use crate::agent::orchestration::fleet_tools::FleetToolSet;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs
index a696ed18d8..83b615775d 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs
@@ -2,7 +2,7 @@
use tinyagents_harness::ids::TaskId;
use tinyagents_harness::run_queue::QueueLane;
-use tinyagents_orchestration::subagent::{steer_detached, SteerAccess, SteerError};
+use tinyagents_orchestration::subagent::{SteerAccess, SteerError, steer_detached};
use super::cancel::now_ms;
use super::registry::{control_admits, owner_key, 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 ffec82d723..72446611f9 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
@@ -11,13 +11,13 @@ use std::path::{Path, PathBuf};
use std::sync::{Arc, OnceLock};
use tinyagents_orchestration::subagent::{
- list_subagent_records, orphaned_subagent_reason, record_agent_id,
+ 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,
+ subagent_record_for_task, task_status_label,
};
use tinyagents_tasks::{
- reconcile_orphaned_tasks, DriverTaskStore, InMemoryTaskStore, OrchestrationTaskFilter,
- OrchestrationTaskRecord, TaskStore, TaskStoreRegistry,
+ DriverTaskStore, InMemoryTaskStore, OrchestrationTaskFilter, OrchestrationTaskRecord,
+ TaskStore, TaskStoreRegistry, reconcile_orphaned_tasks,
};
#[cfg(test)]
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
index 40716203c6..2a6ca43fa8 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
@@ -584,9 +584,11 @@ async fn saas_controls_follow_the_explicit_context_not_the_tasks_scope() {
Err(SteerError::NotOwned)
);
assert_eq!(pair.a.queue.status().await.steers, 0);
- assert!(snapshot_for_parent(&bob, PARENT)
- .iter()
- .all(|worker| worker.task_id != a_task));
+ assert!(
+ snapshot_for_parent(&bob, PARENT)
+ .iter()
+ .all(|worker| worker.task_id != a_task)
+ );
assert!(
cancel_by_task(&alice, &b_task).is_none(),
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 3b3b14b550..443acd3940 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
@@ -21,7 +21,7 @@ use tinyagents_harness::run_queue::{QueueLane, RunQueue};
use tinyagents_harness::steering::{SteeringCommand, SteeringHandle};
use tinyagents_orchestration::subagent::FinishedOutcome;
use tinyagents_orchestration::subagent::{
- DetachedSubagentStatus, WaitError, WaitOutcome, DETACHED_LEDGER_TIMEOUT_MS,
+ DETACHED_LEDGER_TIMEOUT_MS, DetachedSubagentStatus, WaitError, WaitOutcome,
};
use tinyagents_tasks::OrchestrationTaskStatus;
use tokio::sync::watch;
@@ -281,13 +281,15 @@ async fn snapshot_and_block_scope_to_parent_and_reflect_live_status() {
assert!(block.ends_with("[/active_subagents]\n\n"));
// A parent with no registered workers gets no block (no perturbation).
- assert!(active_subagents_context_block(
- &cx(),
- "nobody-here",
- &test_workspace(),
- &FleetToolSet::all()
- )
- .is_none());
+ assert!(
+ active_subagents_context_block(
+ &cx(),
+ "nobody-here",
+ &test_workspace(),
+ &FleetToolSet::all()
+ )
+ .is_none()
+ );
// The shipped orchestrator has no wait/steer/close tools (#5701): the
// guidance must not name them and must say results arrive on their own.
@@ -369,13 +371,15 @@ async fn snapshot_and_block_scope_to_parent_and_reflect_live_status() {
assert!(block.contains("status=idle"));
assert!(block.contains("about: Daily X trending email workflow"));
// Other parents' durable sessions must not leak in.
- assert!(active_subagents_context_block(
- &cx(),
- "unrelated-parent",
- durable_ws.path(),
- &FleetToolSet::all()
- )
- .is_none());
+ assert!(
+ active_subagents_context_block(
+ &cx(),
+ "unrelated-parent",
+ durable_ws.path(),
+ &FleetToolSet::all()
+ )
+ .is_none()
+ );
}
let _ = tx_a.send(DetachedSubagentStatus::Completed {
@@ -524,15 +528,17 @@ async fn wait_times_out_and_leaves_entry_intact() {
));
// still steerable after a timed-out wait
- assert!(steer(
- &cx(),
- "task-slow",
- "session-A",
- "still here".into(),
- QueueLane::Steer
- )
- .await
- .is_ok());
+ assert!(
+ steer(
+ &cx(),
+ "task-slow",
+ "session-A",
+ "still here".into(),
+ QueueLane::Steer
+ )
+ .await
+ .is_ok()
+ );
prune("task-slow");
}
@@ -580,15 +586,17 @@ async fn cancel_for_thread_aborts_only_matching_entries() {
.await
.is_ok()
);
- assert!(steer(
- &cx(),
- "task-headless",
- "session-A",
- "x".into(),
- QueueLane::Steer
- )
- .await
- .is_ok());
+ assert!(
+ steer(
+ &cx(),
+ "task-headless",
+ "session-A",
+ "x".into(),
+ QueueLane::Steer
+ )
+ .await
+ .is_ok()
+ );
// Idempotent: a second pass cancels nothing.
assert_eq!(cancel_for_thread(&cx(), "thread-X"), 0);
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel.rs
index 6860762134..fbb9671e4e 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel.rs
@@ -32,13 +32,13 @@ mod staging;
mod types;
mod workers;
-pub(crate) use collect::{format_spawn_parallel_success, SpawnParallelGraphOutcome};
+pub(crate) use collect::{SpawnParallelGraphOutcome, format_spawn_parallel_success};
pub(crate) use run::run_spawn_parallel_tasks_with_cancellation_and_workspace;
pub(crate) use types::ParallelAgentTask;
#[cfg(test)]
pub(crate) use staging::{
- prepare_spawn_parallel_tasks_from_defs, ParallelTaskRejectionKind, SpawnParallelTaskPreflight,
+ ParallelTaskRejectionKind, SpawnParallelTaskPreflight, prepare_spawn_parallel_tasks_from_defs,
};
#[cfg(test)]
pub(crate) use types::{ParallelAgentLineage, ParallelAgentResult, ParallelAgentStatus};
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
index 9adeba0f5d..0bb7487c40 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
@@ -18,8 +18,8 @@ use crate::progress::AgentProgress;
use tinyagents_definition::SandboxMode;
use super::staging::{
- prepare_spawn_parallel_tasks_from_defs, worktree_request_for_task, ParallelTaskRejectionKind,
- ParallelWorktreeRequest, SpawnParallelTaskPreflight,
+ ParallelTaskRejectionKind, ParallelWorktreeRequest, SpawnParallelTaskPreflight,
+ prepare_spawn_parallel_tasks_from_defs, worktree_request_for_task,
};
use super::types::{
ParallelAgentLineage, ParallelAgentResult, ParallelAgentStatus, ParallelAgentTask,
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs
index 3fe8077b94..048005e375 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs
@@ -14,7 +14,7 @@ use tinytools::WorkspaceDescriptor;
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use super::collect::{
- collect_spawn_parallel_results, project_spawn_parallel_result, SpawnParallelGraphOutcome,
+ SpawnParallelGraphOutcome, collect_spawn_parallel_results, project_spawn_parallel_result,
};
use super::dispatch::stage_spawn_parallel_workers_from_defs;
use super::staging::snapshot_agent_definitions;
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs
index 9a20442ff9..2503db5c40 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs
@@ -15,7 +15,7 @@ use std::path::PathBuf;
use parking_lot::Mutex;
-use tinyagents_graph::parallel::{parse_relative_claim_paths, ClaimConflict, ClaimPathError};
+use tinyagents_graph::parallel::{ClaimConflict, ClaimPathError, parse_relative_claim_paths};
use tinyagents_orchestration::parallel::WorkerDispatchMode;
use tinyagents_orchestration::parallel::{
AdmissionPolicy, AdmissionVerdict, Plan, Preflight, Rejection, RejectionKind, Task,
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
index a37b01d582..8575b30140 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
@@ -6,10 +6,10 @@
use std::path::PathBuf;
use tinyagents_harness::CancellationToken;
-use tinyagents_orchestration::parallel::{resolve_concurrency, run, Worker};
+use tinyagents_orchestration::parallel::{Worker, resolve_concurrency, run};
use crate::agent::subagent_host::{
- run_subagent_with_parent, SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
use super::types::{ParallelAgentResult, ParallelAgentStatus, SpawnParallelWorker};
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs
index 6dc9e2c7a3..c8a8555961 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs
@@ -5,11 +5,11 @@ mod tiny_port;
mod types;
pub use ops::{
- action_root_key, cancel_driver_job_by_task, cancel_driver_job_for_observed_session,
- cancel_driver_jobs_for_thread, close_if_current, find_reusable, list_for_parent,
- mark_driver_pause_cancelled, mark_failed, mark_finished, normalize_task_key,
- resolve_lifecycle_key, reuse_decision, task_title_from_prompt, upsert_running,
- DriverTaskCancellation,
+ DriverTaskCancellation, action_root_key, cancel_driver_job_by_task,
+ cancel_driver_job_for_observed_session, cancel_driver_jobs_for_thread, close_if_current,
+ find_reusable, list_for_parent, mark_driver_pause_cancelled, mark_failed, mark_finished,
+ normalize_task_key, resolve_lifecycle_key, reuse_decision, task_title_from_prompt,
+ upsert_running,
};
pub(crate) use tiny_port::OpenHumanTinySubagentSessionStore;
pub use types::{
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops.rs
index 6093af3359..8e42c7967e 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops.rs
@@ -18,9 +18,8 @@ mod driver;
#[cfg(test)]
use driver::record_cancel_reason;
pub use driver::{
- cancel_driver_job_by_task, cancel_driver_job_for_observed_session,
+ DriverTaskCancellation, cancel_driver_job_by_task, cancel_driver_job_for_observed_session,
cancel_driver_jobs_for_thread, mark_driver_pause_cancelled, resolve_lifecycle_key,
- DriverTaskCancellation,
};
pub fn normalize_task_key(input: &str) -> String {
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 f4ba4a10df..fc0fa92072 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
@@ -107,43 +107,51 @@ fn stale_completion_cannot_overwrite_reused_or_closed_session() {
.unwrap();
assert_eq!(first.subagent_session_id, second.subagent_session_id);
- assert!(mark_finished(
- &store,
- &second.subagent_session_id,
- "first-task",
- &SubagentRunStatus::Completed,
- vec![TranscriptMessage::user("stale")],
- )
- .is_err());
+ assert!(
+ mark_finished(
+ &store,
+ &second.subagent_session_id,
+ "first-task",
+ &SubagentRunStatus::Completed,
+ vec![TranscriptMessage::user("stale")],
+ )
+ .is_err()
+ );
let current = store.load().unwrap().remove(0);
assert_eq!(current.current_task_id.as_deref(), Some("second-task"));
assert_eq!(current.status, DurableSubagentStatus::Running);
assert!(current.latest_history.is_none());
- assert!(mark_failed(
- &store,
- &second.subagent_session_id,
- "first-task",
- "stale failure".into(),
- )
- .is_err());
+ assert!(
+ mark_failed(
+ &store,
+ &second.subagent_session_id,
+ "first-task",
+ "stale failure".into(),
+ )
+ .is_err()
+ );
assert!(store.load().unwrap()[0].latest_error.is_none());
close(&store, &second.subagent_session_id).unwrap();
- assert!(mark_finished(
- &store,
- &second.subagent_session_id,
- "second-task",
- &SubagentRunStatus::Completed,
- vec![TranscriptMessage::user("late after close")],
- )
- .is_err());
- assert!(mark_failed(
- &store,
- &second.subagent_session_id,
- "second-task",
- "late failure".into(),
- )
- .is_err());
+ assert!(
+ mark_finished(
+ &store,
+ &second.subagent_session_id,
+ "second-task",
+ &SubagentRunStatus::Completed,
+ vec![TranscriptMessage::user("late after close")],
+ )
+ .is_err()
+ );
+ assert!(
+ mark_failed(
+ &store,
+ &second.subagent_session_id,
+ "second-task",
+ "late failure".into(),
+ )
+ .is_err()
+ );
let closed = store.load().unwrap().remove(0);
assert_eq!(closed.status, DurableSubagentStatus::Closed);
assert!(closed.latest_history.is_none());
@@ -221,12 +229,14 @@ fn driver_task_cancel_reports_legacy_failure_and_refuses_ambiguous_ids() {
.unwrap()
.is_none()
);
- assert!(store
- .load()
- .unwrap()
- .iter()
- .filter(|row| row.current_task_id.as_deref() == Some("same-public-id"))
- .all(|row| row.status == DurableSubagentStatus::Running));
+ assert!(
+ store
+ .load()
+ .unwrap()
+ .iter()
+ .filter(|row| row.current_task_id.as_deref() == Some("same-public-id"))
+ .all(|row| row.status == DurableSubagentStatus::Running)
+ );
}
#[test]
@@ -495,14 +505,16 @@ fn upsert_persists_the_full_lifecycle_key_without_collapsing_to_task_id() {
)
.unwrap();
assert_eq!(resolved, key);
- assert!(resolve_lifecycle_key(
- &store,
- &session.subagent_session_id,
- "another-parent",
- Some("thread-a"),
- dir.path(),
- )
- .is_err());
+ assert!(
+ resolve_lifecycle_key(
+ &store,
+ &session.subagent_session_id,
+ "another-parent",
+ Some("thread-a"),
+ dir.path(),
+ )
+ .is_err()
+ );
}
#[test]
@@ -563,12 +575,14 @@ fn list_for_parent_without_thread_id_does_not_filter_by_thread() {
let all = list_for_parent(&store, "parent-a", None).unwrap();
assert_eq!(all.len(), 2);
- assert!(all
- .iter()
- .any(|session| session.subagent_session_id == first.subagent_session_id));
- assert!(all
- .iter()
- .any(|session| session.subagent_session_id == second.subagent_session_id));
+ assert!(
+ all.iter()
+ .any(|session| session.subagent_session_id == first.subagent_session_id)
+ );
+ assert!(
+ all.iter()
+ .any(|session| session.subagent_session_id == second.subagent_session_id)
+ );
let thread_a = list_for_parent(&store, "parent-a", Some("thread-a")).unwrap();
assert_eq!(thread_a.len(), 1);
@@ -579,14 +593,16 @@ fn list_for_parent_without_thread_id_does_not_filter_by_thread() {
fn missing_session_updates_return_errors() {
let dir = tempfile::tempdir().unwrap();
let store = SubagentSessionStore::new(dir.path().to_path_buf());
- assert!(mark_finished(
- &store,
- "missing",
- "sub-1",
- &SubagentRunStatus::Completed,
- vec![]
- )
- .is_err());
+ assert!(
+ mark_finished(
+ &store,
+ "missing",
+ "sub-1",
+ &SubagentRunStatus::Completed,
+ vec![]
+ )
+ .is_err()
+ );
assert!(mark_failed(&store, "missing", "sub-1", "boom".into()).is_err());
assert!(!close(&store, "missing").unwrap());
}
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
index 445c93f1b8..0cf5de3a91 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
@@ -24,8 +24,8 @@ use serde_json::Value;
use tinystoragedrivers::{CollectionSpec, Precondition, Query, Sort};
use super::types::DurableSubagentSession;
-use crate::storage::documents::Repo;
use crate::storage::DocumentStoreExt;
+use crate::storage::documents::Repo;
const SESSIONS: &str = "subagent_sessions";
/// Holds the marker document that records the one-time legacy file import, in
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
index 6998431619..dcd62a85ba 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
@@ -35,10 +35,12 @@ fn session(id: &str) -> DurableSubagentSession {
#[test]
fn a_missing_list_loads_empty() {
- assert!(docs_in(&MemoryStorage::new(), "local")
- .load()
- .unwrap()
- .is_empty());
+ assert!(
+ docs_in(&MemoryStorage::new(), "local")
+ .load()
+ .unwrap()
+ .is_empty()
+ );
}
#[test]
@@ -81,10 +83,11 @@ fn the_store_uses_the_workspace_default_with_no_backend_installed() {
store.save(&[session("a")]).unwrap();
assert_eq!(store.load().unwrap().len(), 1);
// No JSON file store: the records are in the workspace's own database.
- assert!(!dir
- .path()
- .join(".openhuman/subagent_sessions.json")
- .exists());
+ assert!(
+ !dir.path()
+ .join(".openhuman/subagent_sessions.json")
+ .exists()
+ );
assert!(dir.path().join("storage").exists());
}
@@ -117,10 +120,11 @@ fn the_store_dispatches_to_documents_when_a_backend_is_pinned() {
assert_eq!(store.load().unwrap().len(), 1);
});
assert_eq!(docs.load().unwrap().len(), 1);
- assert!(!dir
- .path()
- .join(".openhuman/subagent_sessions.json")
- .exists());
+ assert!(
+ !dir.path()
+ .join(".openhuman/subagent_sessions.json")
+ .exists()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
index 2ff2a91bf5..e1f0e3ecd6 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
@@ -39,16 +39,18 @@ async fn old_rows_without_checkpoint_identity_remain_readable_without_fabricated
assert_eq!(sessions[0].subagent_session_id, "legacy-session");
assert_eq!(sessions[0].current_task_id.as_deref(), Some("legacy-task"));
assert!(sessions[0].lifecycle_key.is_none());
- assert!(port
- .list_for_parent("foreign-owner", Some("thread"))
- .await
- .unwrap()
- .is_empty());
- assert!(port
- .list_for_parent("owner", Some("other-thread"))
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ port.list_for_parent("foreign-owner", Some("thread"))
+ .await
+ .unwrap()
+ .is_empty()
+ );
+ assert!(
+ port.list_for_parent("owner", Some("other-thread"))
+ .await
+ .unwrap()
+ .is_empty()
+ );
assert_eq!(port.list_for_parent("owner", None).await.unwrap().len(), 1);
assert!(port.get("legacy-session").await.unwrap().is_some());
let other_thread = OpenHumanTinySubagentSessionStore::new(
@@ -95,11 +97,12 @@ async fn unthreaded_port_lists_only_unthreaded_rows() {
let sessions = port.list_for_parent("owner", None).await.unwrap();
assert_eq!(sessions.len(), 1);
assert_eq!(sessions[0].subagent_session_id, "unthreaded-session");
- assert!(port
- .list_for_parent("owner", Some("thread-a"))
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ port.list_for_parent("owner", Some("thread-a"))
+ .await
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -204,37 +207,41 @@ async fn upsert_rejects_a_selector_or_lifecycle_key_outside_bound_scope() {
}
};
- assert!(port
- .upsert_running(upsert(
+ assert!(
+ port.upsert_running(upsert(
"foreign",
Some("thread-a"),
key(Some("thread-a"), "task-1")
))
.await
- .is_err());
- assert!(port
- .upsert_running(upsert(
+ .is_err()
+ );
+ assert!(
+ port.upsert_running(upsert(
"owner",
Some("thread-b"),
key(Some("thread-b"), "task-1")
))
.await
- .is_err());
- assert!(port
- .upsert_running(upsert(
+ .is_err()
+ );
+ assert!(
+ port.upsert_running(upsert(
"owner",
Some("thread-a"),
key(Some("thread-b"), "task-1")
))
.await
- .is_err());
- assert!(port
- .upsert_running(upsert(
+ .is_err()
+ );
+ assert!(
+ port.upsert_running(upsert(
"owner",
Some("thread-a"),
key(Some("thread-a"), "other-task")
))
.await
- .is_err());
+ .is_err()
+ );
assert!(store.load().unwrap().is_empty());
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools.rs b/crates/openhuman-core/src/agent/orchestration/tools.rs
index 67b81f2222..d71ddd104d 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools.rs
@@ -45,10 +45,10 @@ mod tools_e2e_tests;
pub(crate) use dispatch::DelegationDispatch;
pub(crate) use subagent_control_surfaces::overlay_task_store_status;
pub(crate) use subagent_control_surfaces::{
- format_running_wait_message, requested_timeout_secs, wait_status_payload,
+ CloseSubagentTool, ListSubagentsTool, SteerSubagentTool, WaitSubagentTool,
};
pub(crate) use subagent_control_surfaces::{
- CloseSubagentTool, ListSubagentsTool, SteerSubagentTool, WaitSubagentTool,
+ format_running_wait_message, requested_timeout_secs, wait_status_payload,
};
/// A minimal live TinyAgents carrier over `parent`, for tests that drive a
@@ -67,13 +67,13 @@ pub(crate) fn live_parent_run_context(
}
pub use archetype_delegation::{ArchetypeDelegationTool, DelegationTarget};
-pub use collapsed_delegation::{CollapsedDelegationTool, DelegateTarget, DELEGATE_TO_TOOL_NAME};
+pub use collapsed_delegation::{CollapsedDelegationTool, DELEGATE_TO_TOOL_NAME, DelegateTarget};
pub(crate) use continue_subagent::ContinueSubagentDispatch;
pub use continue_subagent::ContinueSubagentTool;
pub(crate) use delegate_graph::DelegateGraphDispatch;
pub use delegate_graph::DelegateGraphTool;
pub(crate) use spawn_async_subagent::SpawnAsyncSubagentDispatch;
-pub use spawn_async_subagent::{scope_spawn_async_subagent_spec, SpawnAsyncSubagentTool};
+pub use spawn_async_subagent::{SpawnAsyncSubagentTool, scope_spawn_async_subagent_spec};
pub(crate) use spawn_parallel_agents::SpawnParallelAgentsDispatch;
pub use spawn_parallel_agents::SpawnParallelAgentsTool;
pub(crate) use spawn_subagent::SpawnSubagentDispatch;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs
index 8428d8682d..a132d13a71 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs
@@ -1,6 +1,6 @@
use async_trait::async_trait;
-use serde_json::json;
use serde_json::Value;
+use serde_json::json;
use tinytools::ToolRunContext;
use tinytools::{
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs
index c67772951f..10789e7083 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs
@@ -56,7 +56,7 @@
//! [`ToolExposure::Hidden`]: tinytools::ToolExposure::Hidden
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use super::archetype_delegation::{delegation_envelope_properties, render_structured_handoff};
use tinytools::ToolRunContext;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs
index 82f43e6c34..a90d881ea6 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs
@@ -10,8 +10,8 @@
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::subagent_host::{
- continue_subagent, continue_subagent_via_driver_tool, load_subagent_checkpoint,
- SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, continue_subagent, continue_subagent_via_driver_tool,
+ load_subagent_checkpoint,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::progress::AgentProgress;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs
index 7cfadc95eb..f6f29f7715 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs
@@ -4,7 +4,7 @@ use std::sync::Arc;
use tinytools::Tool;
use super::super::collapsed_delegation::{
- dispatch_targets_from_schema, CollapsedDelegationTool, DelegateTarget,
+ CollapsedDelegationTool, DelegateTarget, dispatch_targets_from_schema,
};
use super::super::delegate_graph::DelegateGraphDispatch;
use crate::tools::delegate::DelegateToolDispatch;
@@ -247,9 +247,11 @@ async fn config_delegate_dispatch_preserves_tool_failure_in_shared_jobs() {
.expect("the host returns the configured tool result");
assert!(result.is_error);
- assert!(result
- .output()
- .contains("configured policy rejected the request"));
+ assert!(
+ result
+ .output()
+ .contains("configured policy rejected the request")
+ );
assert!(
jobs.list().iter().any(|job| {
job.agent == "configured-error"
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs
index 876c86d286..fc66dccc8b 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs
@@ -4,11 +4,13 @@ use crate::agent::orchestration::subagent_sessions;
#[test]
fn schema_has_no_required_fields() {
let schema = ListSubagentsTool::new().parameters_schema();
- assert!(schema
- .get("required")
- .and_then(|v| v.as_array())
- .expect("required")
- .is_empty());
+ assert!(
+ schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .expect("required")
+ .is_empty()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs
index 5d2134a46f..88121b8aac 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs
@@ -27,9 +27,9 @@ pub(super) fn make_completion(
Result<SubagentRunOutcome, String>,
bool,
) -> std::pin::Pin<Box<dyn std::future::Future<Output = ()> + Send>>
- + Send
- + Sync
- + 'static {
++ Send
++ Sync
++ 'static {
move |_target: String,
result: Result<SubagentRunOutcome, String>,
emit_lifecycle_effects: bool|
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
index 8186eb6882..6aac1c51fd 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
@@ -301,9 +301,10 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {
.iter()
.filter_map(|v| v.as_str())
.collect();
- assert!(next
- .iter()
- .any(|a| a.contains("delivered to you automatically")));
+ assert!(
+ next.iter()
+ .any(|a| a.contains("delivered to you automatically"))
+ );
let message = format_async_subagent_accepted("task_manager_agent", &serialized, &fleet);
let prose = message.split("[async_subagent_ref]").next().unwrap();
@@ -615,8 +616,10 @@ fn scoped_instance_advertises_exactly_the_allowlist() {
schema["properties"]["agent_id"]["enum"],
serde_json::json!(["agent_memory", "workflow_builder"])
);
- assert!(schema["properties"]["agent_id"]["description"]
- .as_str()
- .unwrap_or_default()
- .contains("only these are dispatchable"));
+ assert!(
+ schema["properties"]["agent_id"]["description"]
+ .as_str()
+ .unwrap_or_default()
+ .contains("only these are dispatchable")
+ );
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
index 3c8d6bfff9..e0aa14c8c5 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
@@ -6,8 +6,8 @@ use crate::agent::orchestration::spawn_parallel::ParallelAgentLineage;
use crate::agent::orchestration::spawn_parallel::ParallelAgentResult;
use crate::agent::orchestration::spawn_parallel::ParallelAgentTask;
use crate::agent::orchestration::spawn_parallel::{
- format_spawn_parallel_success, run_spawn_parallel_tasks_with_cancellation_and_workspace,
- SpawnParallelGraphOutcome,
+ SpawnParallelGraphOutcome, format_spawn_parallel_success,
+ run_spawn_parallel_tasks_with_cancellation_and_workspace,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
index 449c958c51..a8f0bb1e03 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
@@ -210,12 +210,16 @@ async fn collects_immediate_task_validation_failures() {
.iter()
.map(|result| result["error"].as_str().unwrap_or_default())
.collect::<Vec<_>>();
- assert!(errors
- .iter()
- .any(|error| error.contains("agent_id and prompt")));
- assert!(errors
- .iter()
- .any(|error| error.contains("unknown agent_id")));
+ assert!(
+ errors
+ .iter()
+ .any(|error| error.contains("agent_id and prompt"))
+ );
+ assert!(
+ errors
+ .iter()
+ .any(|error| error.contains("unknown agent_id"))
+ );
}
#[test]
@@ -303,9 +307,11 @@ fn shared_workspace_allows_readonly_or_explicitly_isolated_workers() {
&parent,
);
- assert!(preflight
- .into_iter()
- .all(|item| matches!(item, SpawnParallelTaskPreflight::Prepared(_))));
+ assert!(
+ preflight
+ .into_iter()
+ .all(|item| matches!(item, SpawnParallelTaskPreflight::Prepared(_)))
+ );
}
// This exercises the full parallel-subagent path (parent turn → spawn N
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
index c688170a0f..79e687c7ca 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
@@ -1,10 +1,10 @@
use super::*;
+use crate::agent::OpenHumanSessionHost;
use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::orchestration::spawn_parallel::{
- prepare_spawn_parallel_tasks_from_defs, ParallelTaskRejectionKind, SpawnParallelTaskPreflight,
+ ParallelTaskRejectionKind, SpawnParallelTaskPreflight, prepare_spawn_parallel_tasks_from_defs,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
-use crate::agent::OpenHumanSessionHost;
use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::config::AgentConfig;
@@ -13,8 +13,8 @@ use parking_lot::Mutex;
use serde_json::json;
use std::collections::HashMap;
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use tinyagents_definition::{
AgentTier, DefinitionSource, ModelSpec, PromptSource, SandboxMode, ToolScope,
@@ -29,7 +29,7 @@ use tinytools::{PermissionLevel, Tool, ToolResult};
use tinytools_agent::dialect::NativeDialect;
use tinytools_agent::dialect::ToolCallFormat;
use tinytools_agent::dialect::TranscriptEntry;
-use tokio::time::{sleep, timeout, Duration};
+use tokio::time::{Duration, sleep, timeout};
const PARENT_PROMPT_CANARY: &str = "parallel-fanout-e2e-canary";
const RESEARCH_PROMPT_CANARY: &str = "research-branch-canary";
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
index a8bcbd8253..ce200aad57 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
@@ -14,7 +14,7 @@
//!
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::subagent_host::{
- run_subagent_via_driver_tool, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent_via_driver_tool,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::core::runtime::DispatchCtx;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
index 50d10575ff..fbd7fcc4dd 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
@@ -51,11 +51,13 @@ fn parameters_schema_advertises_dedicated_thread_flag() {
assert_eq!(flag.get("type").and_then(|v| v.as_str()), Some("boolean"));
// Must be off by default — workers are an opt-in escape hatch, not
// a free upgrade for every spawn.
- assert!(schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
- .unwrap_or(true));
+ assert!(
+ schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
+ .unwrap_or(true)
+ );
}
#[test]
@@ -65,11 +67,13 @@ fn parameters_schema_advertises_optional_model_override() {
let props = schema.get("properties").expect("schema has properties");
let model = props.get("model").expect("model override advertised");
assert_eq!(model.get("type").and_then(|v| v.as_str()), Some("string"));
- assert!(schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
- .unwrap_or(true));
+ assert!(
+ schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
+ .unwrap_or(true)
+ );
}
#[test]
@@ -232,9 +236,11 @@ async fn legacy_archetype_alias_is_accepted_for_lookup() {
.await
.unwrap();
assert!(result.is_error);
- assert!(result
- .output()
- .contains("unknown agent_id 'totally_made_up'"));
+ assert!(
+ result
+ .output()
+ .contains("unknown agent_id 'totally_made_up'")
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs b/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs
index fab6ef3dcf..42aaf8bf5a 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs
@@ -24,8 +24,8 @@
//! only thing that settles the card. A closed channel has no reader left to
//! settle anything, so that case is logged and dropped.
-use tokio::sync::mpsc::error::TrySendError;
use tokio::sync::mpsc::Sender;
+use tokio::sync::mpsc::error::TrySendError;
use crate::progress::AgentProgress;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs b/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
index 729d779a9f..8b269cbb7e 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
@@ -7,7 +7,7 @@
//! envelopes only.
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyagents_orchestration::subagent::SubagentResumeRef;
use tinytools::{PermissionLevel, Tool, ToolResult, ToolTimeout};
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs
index 87479d06ee..cdcfb7ad8c 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs
@@ -1,7 +1,7 @@
//! Subagent dispatch logic shared by all agent delegation tools.
use crate::agent::subagent_host::{
- run_subagent_via_driver_tool, SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, run_subagent_via_driver_tool,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::progress::AgentProgress;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
index c5135023f9..b7abcbaf1e 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
@@ -306,10 +306,11 @@ async fn cancelling_a_paused_driver_through_rpc_settles_once_with_its_reason() {
.find(|row| row.current_task_id.as_deref() == Some(task_id.as_str()))
.expect("cancelled durable session remains available");
assert_eq!(row.status, DurableSubagentStatus::Failed);
- assert!(row
- .latest_error
- .as_deref()
- .is_some_and(|error| error.contains("user requested stop")));
+ assert!(
+ row.latest_error
+ .as_deref()
+ .is_some_and(|error| error.contains("user requested stop"))
+ );
let deliveries = pending_for(workspace.path(), "paused-cancel-rpc-thread");
assert_eq!(deliveries.len(), 1);
assert_eq!(deliveries[0].status, CompletionStatus::Failed);
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs
index de81145a7c..3b934e161e 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs
@@ -5,7 +5,7 @@ async fn driver_job_controls_are_isolated_by_workspace_with_shared_runtime_state
use crate::agent::orchestration::subagent_sessions::{
DurableSubagentSession, DurableSubagentStatus, SubagentSessionStore,
};
- use crate::agent::subagent_host::{run_subagent_via_driver_tool, SubagentRunOptions};
+ use crate::agent::subagent_host::{SubagentRunOptions, run_subagent_via_driver_tool};
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
use crate::tools::toolpacks::ToolGroups;
use tinyagents_harness::agent_loop::phases::execute_tool_batch;
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs
index ec603dccdd..dc8b108d17 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs
@@ -2,24 +2,24 @@
//! that drives a run's phase DAG to completion.
use crate::core::runtime::DispatchCtx;
-use anyhow::{anyhow, Context, Result};
+use anyhow::{Context, Result, anyhow};
use serde_json::Value;
use std::sync::Arc;
-use tinyagents_orchestration::workflow::{reset_running_phases, WorkflowEngine};
+use tinyagents_orchestration::workflow::{WorkflowEngine, reset_running_phases};
use crate::agent::harness::ParentExecutionContext;
use crate::agent::orchestration::parent_context::with_root_parent;
use crate::config::Config;
use tinyagents_session::run_ledger::{WorkflowRun, WorkflowRunStatus, WorkflowRunUpsert};
+use super::LOG_TARGET;
use super::cancel::{
- cancel_signal_if_current, clear_cancel_signal, is_current_cancel_signal, lookup_cancel_signal,
- register_cancel_signal, replace_cancel_signal, WorkflowCancelSignal,
+ WorkflowCancelSignal, cancel_signal_if_current, clear_cancel_signal, is_current_cancel_signal,
+ lookup_cancel_signal, register_cancel_signal, replace_cancel_signal,
};
use super::ops::{
compare_and_swap_workflow_run_lifecycle, definition_by_id, get_workflow_run, workflow_store,
};
-use super::LOG_TARGET;
use tinyagents_orchestration::workflow::WorkflowDefinition;
/// Start a new workflow run and return immediately.
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
index 7fcc4202d4..861fd7be58 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
@@ -2,7 +2,7 @@
use std::sync::Arc;
-use anyhow::{anyhow, Result};
+use anyhow::{Result, anyhow};
use async_trait::async_trait;
use serde_json::json;
use tinyagents_harness::CancellationToken;
diff --git a/crates/openhuman-core/src/agent_runs/agent_teams/schemas.rs b/crates/openhuman-core/src/agent_runs/agent_teams/schemas.rs
index b0ef8737ce..d710dc8b5e 100644
--- a/crates/openhuman-core/src/agent_runs/agent_teams/schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/agent_teams/schemas.rs
@@ -10,8 +10,8 @@
use crate::core::runtime::DispatchCtx;
use serde_json::{Map, Value};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_session::run_ledger::AgentTeamListRequest;
diff --git a/crates/openhuman-core/src/agent_runs/command_center/schemas.rs b/crates/openhuman-core/src/agent_runs/command_center/schemas.rs
index a5c207d9eb..1b93f1e6b8 100644
--- a/crates/openhuman-core/src/agent_runs/command_center/schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/command_center/schemas.rs
@@ -8,8 +8,8 @@ use serde_json::{Map, Value};
use tinyagents_session::run_ledger::command_center::ControlVerb;
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Controller schemas exposed by the command center.
diff --git a/crates/openhuman-core/src/agent_runs/context_breakdown.rs b/crates/openhuman-core/src/agent_runs/context_breakdown.rs
index 63626a1d52..1820aeef42 100644
--- a/crates/openhuman-core/src/agent_runs/context_breakdown.rs
+++ b/crates/openhuman-core/src/agent_runs/context_breakdown.rs
@@ -19,10 +19,10 @@ use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use crate::config::Config;
-use crate::core::agent_cli::debug::prompt_size::{PromptSizeReport, SectionSize, ToolSize};
+use crate::core::Outcome;
use crate::core::agent_cli::debug::DumpPromptOptions;
+use crate::core::agent_cli::debug::prompt_size::{PromptSizeReport, SectionSize, ToolSize};
use crate::core::runtime::DispatchCtx;
-use crate::core::Outcome;
/// Default agent whose prompt is measured when the caller names none — the
/// one every main chat turn actually runs under.
diff --git a/crates/openhuman-core/src/agent_runs/context_breakdown_tests.rs b/crates/openhuman-core/src/agent_runs/context_breakdown_tests.rs
index 3bbdec4c08..cdc34a7478 100644
--- a/crates/openhuman-core/src/agent_runs/context_breakdown_tests.rs
+++ b/crates/openhuman-core/src/agent_runs/context_breakdown_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use crate::core::agent_cli::debug::prompt_size::PromptSizeReport;
use crate::core::agent_cli::debug::DumpedPrompt;
+use crate::core::agent_cli::debug::prompt_size::PromptSizeReport;
fn sample_dump() -> DumpedPrompt {
DumpedPrompt {
diff --git a/crates/openhuman-core/src/agent_runs/mod.rs b/crates/openhuman-core/src/agent_runs/mod.rs
index e526a73b79..07d44b5883 100644
--- a/crates/openhuman-core/src/agent_runs/mod.rs
+++ b/crates/openhuman-core/src/agent_runs/mod.rs
@@ -5,8 +5,8 @@ pub(crate) mod command_center;
pub(crate) mod context_breakdown;
pub(crate) mod replay;
mod schemas;
-mod subagent_finalize;
pub(crate) mod subagent_control;
+mod subagent_finalize;
pub(crate) mod workflow_runs;
pub(crate) mod worktree_schemas;
@@ -35,8 +35,8 @@ pub(crate) fn register_subagent_finalize_subscriber(config: &crate::config::Conf
}
/// Registers the orchestration RPC surfaces in their catalogue order.
-pub(crate) fn all_orchestration_registered_controllers(
-) -> Vec<crate::core::all::RegisteredController> {
+pub(crate) fn all_orchestration_registered_controllers()
+-> Vec<crate::core::all::RegisteredController> {
let mut controllers = Vec::new();
controllers.extend(all_command_center_registered_controllers());
controllers.extend(all_workflow_run_registered_controllers());
diff --git a/crates/openhuman-core/src/agent_runs/replay/ops.rs b/crates/openhuman-core/src/agent_runs/replay/ops.rs
index 0895beeced..b6e2fcf745 100644
--- a/crates/openhuman-core/src/agent_runs/replay/ops.rs
+++ b/crates/openhuman-core/src/agent_runs/replay/ops.rs
@@ -7,8 +7,8 @@
use std::path::Path;
use tinyagents_harness::events::HarnessRunStatus;
-use tinyagents_harness::observability::replay::{self, RunEventsPage};
use tinyagents_harness::observability::StoreEventJournal;
+use tinyagents_harness::observability::replay::{self, RunEventsPage};
/// Paged late-attach replay reader over the durable journal under `workspace`.
pub(crate) async fn read_run_events_page(
diff --git a/crates/openhuman-core/src/agent_runs/replay/schemas.rs b/crates/openhuman-core/src/agent_runs/replay/schemas.rs
index 49542d262f..75c5e3dc62 100644
--- a/crates/openhuman-core/src/agent_runs/replay/schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/replay/schemas.rs
@@ -113,8 +113,7 @@ fn replay_schema(function: &str) -> ControllerSchema {
"run_events" => ControllerSchema {
namespace: NAMESPACE,
function: "run_events",
- description:
- "Read-only paged replay of a durable agent run's event stream (late-attach \
+ description: "Read-only paged replay of a durable agent run's event stream (late-attach \
reconnect/backfill). Returns AgentObservations at offset >= `offset` in order, \
plus `next_offset` (null once drained). Never mutates state.",
inputs: vec![
@@ -156,8 +155,7 @@ fn replay_schema(function: &str) -> ControllerSchema {
"run_status" => ControllerSchema {
namespace: NAMESPACE,
function: "run_status",
- description:
- "Read-only latest durable status snapshot (HarnessRunStatus) for a run, or null \
+ description: "Read-only latest durable status snapshot (HarnessRunStatus) for a run, or null \
when the run is unknown. Counters/phase/usage/cost only — never prompts or \
payloads.",
inputs: vec![FieldSchema {
@@ -176,8 +174,7 @@ fn replay_schema(function: &str) -> ControllerSchema {
"runs_active" => ControllerSchema {
namespace: NAMESPACE,
function: "runs_active",
- description:
- "Read-only listing of active (pending/running/interrupted) agent runs, optionally \
+ description: "Read-only listing of active (pending/running/interrupted) agent runs, optionally \
filtered by `thread_id` and/or `root_run_id`. Never mutates state.",
inputs: vec![
FieldSchema {
diff --git a/crates/openhuman-core/src/agent_runs/schemas.rs b/crates/openhuman-core/src/agent_runs/schemas.rs
index 7b6e4e2080..eae006c2d2 100644
--- a/crates/openhuman-core/src/agent_runs/schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/schemas.rs
@@ -1,11 +1,11 @@
use crate::core::runtime::DispatchCtx;
-use serde::de::DeserializeOwned;
use serde::Deserialize;
+use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Params for `agent.chat` and `agent.chat_simple`.
@@ -136,8 +136,7 @@ pub fn schemas(function: &str) -> ControllerSchema {
"list_definitions" => ControllerSchema {
namespace: "agent",
function: "list_definitions",
- description:
- "List safe display metadata for sub-agent definitions in the global registry.",
+ description: "List safe display metadata for sub-agent definitions in the global registry.",
inputs: vec![],
outputs: vec![json_output(
"definitions",
@@ -552,7 +551,7 @@ fn handle_graph_topologies(_ctx: DispatchCtx, _params: Map<String, Value>) -> Co
fn local_catalog_models_from_config(
config: &crate::config::Config,
) -> Vec<crate::platform::cost::catalog::LocalCatalogModel> {
- use tinyinference_local::profile::{profile_for_kind, LocalProviderKind, ToolSupport};
+ use tinyinference_local::profile::{LocalProviderKind, ToolSupport, profile_for_kind};
config
.model_registry
diff --git a/crates/openhuman-core/src/agent_runs/schemas_tests.rs b/crates/openhuman-core/src/agent_runs/schemas_tests.rs
index 7f4b7ca17d..9d9808e673 100644
--- a/crates/openhuman-core/src/agent_runs/schemas_tests.rs
+++ b/crates/openhuman-core/src/agent_runs/schemas_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use crate::core::runtime::DispatchCtx;
use crate::core::TypeSchema;
+use crate::core::runtime::DispatchCtx;
use serde_json::json;
#[test]
@@ -31,21 +31,26 @@ fn schemas_expose_expected_inputs_and_unknown_fallback() {
assert_eq!(chat.namespace, "agent");
assert_eq!(chat.inputs.len(), 5);
assert!(matches!(chat.inputs[1].ty, TypeSchema::Option(_)));
- assert!(chat
- .inputs
- .iter()
- .any(|input| input.name == "thread_id" && !input.required));
+ assert!(
+ chat.inputs
+ .iter()
+ .any(|input| input.name == "thread_id" && !input.required)
+ );
let triage = schemas("triage_evaluate");
assert_eq!(triage.inputs.len(), 7);
- assert!(triage
- .inputs
- .iter()
- .any(|input| input.name == "payload" && input.required));
- assert!(triage
- .inputs
- .iter()
- .any(|input| input.name == "dry_run" && !input.required));
+ assert!(
+ triage
+ .inputs
+ .iter()
+ .any(|input| input.name == "payload" && input.required)
+ );
+ assert!(
+ triage
+ .inputs
+ .iter()
+ .any(|input| input.name == "dry_run" && !input.required)
+ );
let unknown = schemas("nope");
assert_eq!(unknown.function, "unknown");
@@ -92,11 +97,12 @@ async fn graph_topologies_handler_exports_structural_reports() {
for g in graphs {
assert!(g.get("name").and_then(Value::as_str).is_some());
assert_eq!(g.get("ok").and_then(Value::as_bool), Some(true));
- assert!(g
- .get("mermaid")
- .and_then(Value::as_str)
- .unwrap()
- .contains("flowchart"));
+ assert!(
+ g.get("mermaid")
+ .and_then(Value::as_str)
+ .unwrap()
+ .contains("flowchart")
+ );
assert!(
g.get("topology").map(|t| !t.is_null()).unwrap_or(false),
"topology embeds as structured JSON"
@@ -131,11 +137,13 @@ async fn reload_and_definition_handlers_cover_missing_registry_paths() {
.await
.expect("reload handler should always succeed");
assert_eq!(reload.get("status").and_then(Value::as_str), Some("noop"));
- assert!(reload
- .get("note")
- .and_then(Value::as_str)
- .unwrap()
- .contains("Restart"));
+ assert!(
+ reload
+ .get("note")
+ .and_then(Value::as_str)
+ .unwrap()
+ .contains("Restart")
+ );
let list_result = handle_list_definitions(DispatchCtx::process_default(), Map::new()).await;
match list_result {
diff --git a/crates/openhuman-core/src/agent_runs/subagent_control.rs b/crates/openhuman-core/src/agent_runs/subagent_control.rs
index 37236545e1..dcda188b51 100644
--- a/crates/openhuman-core/src/agent_runs/subagent_control.rs
+++ b/crates/openhuman-core/src/agent_runs/subagent_control.rs
@@ -15,13 +15,13 @@
//! cancelled.
use crate::core::runtime::DispatchCtx;
-use serde_json::{json, Map, Value};
+use serde_json::{Map, Value, json};
use tinyagents_orchestration::subagent::SteerError;
use crate::agent::orchestration::running_subagents::CancelledSubagent;
use crate::agent::orchestration::{background_completions, running_subagents, subagent_sessions};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_harness::run_queue::QueueLane;
@@ -166,8 +166,8 @@ fn handle_subagent_cancel(ctx: DispatchCtx, params: Map<String, Value>) -> Contr
} else {
let summary = match reason.as_deref().map(str::trim).filter(|r| !r.is_empty()) {
Some(r) => format!(
- "You cancelled this background sub-agent before it finished. Reason: {r}"
- ),
+ "You cancelled this background sub-agent before it finished. Reason: {r}"
+ ),
None => "You cancelled this background sub-agent before it finished."
.to_string(),
};
diff --git a/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs b/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs
index b0da293296..8a82a22acd 100644
--- a/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs
+++ b/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs
@@ -148,8 +148,8 @@ async fn cancelling_a_paused_driver_queues_a_failed_delivery_with_reason() {
forget_workspace_for_test, pending_for,
};
use crate::agent::orchestration::subagent_sessions::{
- mark_finished, upsert_running, DriverTaskCancellation, DurableSubagentStatus,
- SubagentSessionSelector, SubagentSessionStore, SubagentSessionUpsert,
+ DriverTaskCancellation, DurableSubagentStatus, SubagentSessionSelector,
+ SubagentSessionStore, SubagentSessionUpsert, mark_finished, upsert_running,
};
use tinyagents_orchestration::subagent::SubagentTaskKey;
use tinyagents_tasks::CompletionStatus;
@@ -213,13 +213,15 @@ async fn cancelling_a_paused_driver_queues_a_failed_delivery_with_reason() {
};
forget_workspace_for_test(&workspace_dir);
- assert!(settle_paused_driver_cancel(
- &DispatchCtx::process_default(),
- &observed,
- Some("user requested stop")
- )
- .await
- .expect("paused cancellation settles"));
+ assert!(
+ settle_paused_driver_cancel(
+ &DispatchCtx::process_default(),
+ &observed,
+ Some("user requested stop")
+ )
+ .await
+ .expect("paused cancellation settles")
+ );
let row = store.load().unwrap().remove(0);
assert_eq!(row.status, DurableSubagentStatus::Failed);
diff --git a/crates/openhuman-core/src/agent_runs/workflow_runs/ops_tests.rs b/crates/openhuman-core/src/agent_runs/workflow_runs/ops_tests.rs
index 7fe46fcb60..2e8282cbfc 100644
--- a/crates/openhuman-core/src/agent_runs/workflow_runs/ops_tests.rs
+++ b/crates/openhuman-core/src/agent_runs/workflow_runs/ops_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use tinyagents_orchestration::workflow::{
- validate_agents, validate_structure, DefinitionError, WorkflowDefinition, WorkflowPhase,
+ DefinitionError, WorkflowDefinition, WorkflowPhase, validate_agents, validate_structure,
};
fn good_def() -> WorkflowDefinition {
diff --git a/crates/openhuman-core/src/agent_runs/workflow_runs/schemas.rs b/crates/openhuman-core/src/agent_runs/workflow_runs/schemas.rs
index 32a58d37ea..845a2627e4 100644
--- a/crates/openhuman-core/src/agent_runs/workflow_runs/schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/workflow_runs/schemas.rs
@@ -8,8 +8,8 @@
use crate::core::runtime::DispatchCtx;
use serde_json::{Map, Value};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_session::run_ledger::WorkflowRunListRequest;
diff --git a/crates/openhuman-core/src/agent_runs/worktree_schemas.rs b/crates/openhuman-core/src/agent_runs/worktree_schemas.rs
index b5059136ed..3102e55c84 100644
--- a/crates/openhuman-core/src/agent_runs/worktree_schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/worktree_schemas.rs
@@ -18,14 +18,14 @@
use crate::core::runtime::DispatchCtx;
use std::path::{Path, PathBuf};
-use serde_json::{json, Map, Value};
+use serde_json::{Map, Value, json};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_harness::workspace::{
- detect_worktree_overlaps, git_worktree_diff_summary, git_worktree_status, list_git_worktrees,
- remove_git_worktree, GitWorktreeError, GitWorktreeStatus, GIT_WORKTREE_SUBDIR,
+ GIT_WORKTREE_SUBDIR, GitWorktreeError, GitWorktreeStatus, detect_worktree_overlaps,
+ git_worktree_diff_summary, git_worktree_status, list_git_worktrees, remove_git_worktree,
};
/// Controller schemas exposed by the worktree manager.
diff --git a/crates/openhuman-core/src/agent_runs/worktree_schemas_tests.rs b/crates/openhuman-core/src/agent_runs/worktree_schemas_tests.rs
index d52bd017ec..fa4dd03e1d 100644
--- a/crates/openhuman-core/src/agent_runs/worktree_schemas_tests.rs
+++ b/crates/openhuman-core/src/agent_runs/worktree_schemas_tests.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::core::runtime::DispatchCtx;
use std::process::Command;
-use tinyagents_harness::workspace::{create_git_worktree, GitWorktreeBaseRef, GitWorktreeStatus};
+use tinyagents_harness::workspace::{GitWorktreeBaseRef, GitWorktreeStatus, create_git_worktree};
/// `true` when `git` is invokable on this host. Tests that need real
/// `git worktree` plumbing skip (pass trivially) when it's absent, so a
diff --git a/crates/openhuman-core/src/core/runtime/subscribers_tests.rs b/crates/openhuman-core/src/core/runtime/subscribers_tests.rs
index 865420c2e9..4824309250 100644
--- a/crates/openhuman-core/src/core/runtime/subscribers_tests.rs
+++ b/crates/openhuman-core/src/core/runtime/subscribers_tests.rs
@@ -1,4 +1,4 @@
-use super::{group_first_time_when_bus_ready, DomainSubscriberPlan};
+use super::{DomainSubscriberPlan, group_first_time_when_bus_ready};
use crate::config::test_env::EnvVarGuard;
// ---- domain-subscriber gating (#4796 DoD item 3) ----------------------------