Skip to content

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

docs(agent): clarify orchestration and dispatch comments

Steven Enamakel0264555ec5e3
diff --git a/crates/openhuman-core/src/agent/orchestration/tools.rs b/crates/openhuman-core/src/agent/orchestration/tools.rs
index c2570ca48b..afd0db6919 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools.rs
@@ -1,6 +1,4 @@
-//! Declares the LLM-callable orchestration tools kept in `tools/` (via
-//! `#[path]`, since this file lives in `orchestration/` rather than a
-//! `tools/mod.rs`).
+//! Declares OpenHuman's product orchestration surfaces over TinyAgents.
//!
//! Tools, by role:
//! - **Spawn**: `spawn_subagent`, `spawn_async_subagent`,
@@ -10,14 +8,13 @@
//! - **Delegation**: `DelegateGraphTool`, `ArchetypeDelegationTool`,
//! and `CollapsedDelegationTool` (`delegate_to`).
//!
-//! `dispatch.rs` and `awaiting_user.rs` are `pub(crate)` helpers shared by the
-//! tools above (the common spawn path and awaiting-user envelope), not tools
-//! themselves. Worker-thread persistence lives in `threads`.
+//! TinyAgents owns generic control operations; the host control module keeps
+//! the product declarations and projections. Worker-thread persistence lives
+//! in `threads`.
//!
//! `agent::registration` assembles the delegation tools for the catalogue.
-//! Execution itself goes through
-//! `agent::subagent_host::run_subagent`; this module only owns the tool-call
-//! surface (schema, argument parsing, response formatting).
+//! Execution crosses the shared TinyAgents Jobs/Message and subagent driver
+//! ports while this module retains product-specific policies and envelopes.
#[path = "tools/archetype_delegation.rs"]
mod archetype_delegation;
diff --git a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
index 23110b2b68..e94627e1b4 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
@@ -99,10 +99,10 @@ type ToolDispatchSelector = Arc<ToolDispatchSelectorFn>;
/// context.").
///
/// `adapter` is expected to be the same `CanonicalSharedToolAdapter` seam
-/// used at registration: dispatch selection keys off `name` and the tool's
-/// own schema (via [`DelegationDispatch::for_tool`]'s fallback), not object
-/// identity, so a freshly built adapter over the resolved tool's registry
-/// slot is equivalent to the one the harness itself would have registered.
+/// used at registration. For synthesized archetype routes, the raw registered
+/// tool's `DelegationTarget` host extension is passed separately because the
+/// generic adapter intentionally does not preserve OpenHuman-specific
+/// extensions.
pub(crate) fn typed_dispatch_for(
name: &str,
adapter: Arc<dyn tinytools::Tool>,
diff --git a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs
index 99edaac2a7..ed034dbc4e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs
@@ -170,12 +170,9 @@ impl ToolDispatch<(), OpenHumanRunContext> for UseSkillDispatch {
.map(str::to_string);
// Re-wrap the resolved tool in the same `CanonicalSharedToolAdapter`
- // seam the harness itself builds at registration: typed-dispatch
- // selection keys off the tool's name and schema
- // (`DelegationDispatch::for_tool`), not object identity, so this
- // adapter is equivalent to the one that would have been registered
- // had the model reached `name` directly instead of through
- // `use_skill`.
+ // seam the harness itself builds at registration. The OpenHuman
+ // delegation target is read from the raw packed tool before wrapping,
+ // since it is a host extension rather than portable adapter metadata.
let Some(inner_adapter) = super::tool_registration::shared_tool_adapter(vec![tools], &name)
.map(|adapter| Arc::new(adapter) as Arc<dyn Tool>)
else {