Skip to content

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

refactor(tools): drop the tool_call bridge; deferred tools are called by name

Steven Enamakel5432aa6f27b6
diff --git a/app/src/features/conversations/tools/__fixtures__/coreToolNames.json b/app/src/features/conversations/tools/__fixtures__/coreToolNames.json
index 1321d7178f..f994a85c18 100644
--- a/app/src/features/conversations/tools/__fixtures__/coreToolNames.json
+++ b/app/src/features/conversations/tools/__fixtures__/coreToolNames.json
@@ -192,7 +192,6 @@
"task_source_update",
"tinyjuice_retrieve",
"todo",
- "tool_call",
"tool_search",
"uninstall_workflow",
"update_apply",
diff --git a/crates/openhuman-core/src/agent/prompts/types.rs b/crates/openhuman-core/src/agent/prompts/types.rs
index 87915e42ca..0293f0cdd1 100644
--- a/crates/openhuman-core/src/agent/prompts/types.rs
+++ b/crates/openhuman-core/src/agent/prompts/types.rs
@@ -244,7 +244,7 @@ impl<'a> PromptTool<'a> {
}
/// An entry the catalogue owns rather than borrows: a tool that exists
- /// only for this prompt build (the harness's `tool_search` / `tool_call`
+ /// only for this prompt build (the harness's `tool_search`
/// bridge), with no registration to borrow a name from.
pub fn owned(
name: String,
@@ -306,12 +306,11 @@ impl<'a> PromptTool<'a> {
/// a 71 KB prompt, the exact cost deferral exists to avoid — and told the
/// model to search for an action whose signature it could already read.
///
-/// * **The bridge must take their place.** The harness mints `tool_search` /
-/// `tool_call` onto `request.tools`, which a text dialect drops, and with
-/// `host_renders_tool_catalogue` it appends nothing itself. Without these
-/// entries the model reads "invoke a match with `tool_call`" in a search
-/// result and has no signature for that name; observed live as a turn that
-/// narrates the call it is about to make and then stops.
+/// * **The bridge must take their place.** The harness mints `tool_search`
+/// onto `request.tools`, which a text dialect drops, and with
+/// `host_renders_tool_catalogue` it appends nothing itself. Without this
+/// entry the model has no signature for `tool_search`; observed live as a
+/// turn that narrates the call it is about to make and then stops.
///
/// A native-tool-calling provider is unaffected: it reads `request.tools`,
/// where the harness already puts exactly this pair.
diff --git a/crates/openhuman-core/src/agent/session_host/types.rs b/crates/openhuman-core/src/agent/session_host/types.rs
index 510db1219a..2fbab708dd 100644
--- a/crates/openhuman-core/src/agent/session_host/types.rs
+++ b/crates/openhuman-core/src/agent/session_host/types.rs
@@ -154,7 +154,7 @@ pub struct OpenHumanSessionHost {
/// [`ToolExposure::Deferred`](tinytools::ToolExposure): never in
/// [`Self::visible_tool_names`], never in the prompt's spec list, but
/// handed to the harness beside the visible set so its intrinsic
- /// `tool_search` / `tool_call` bridge can find and run them. Empty for a
+ /// `tool_search` bridge can find them, and they are called by name. Empty for a
/// belt that did not opt into discovery. Classified `Allow` by the
/// policy session exactly like a visible tool — a found tool the gate
/// refused as "prompt-hidden" would be the old unusable find again.
diff --git a/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs b/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs
index effa922a89..9211de6ceb 100644
--- a/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs
@@ -84,17 +84,17 @@ async fn overlap_ranker_ranks_by_token_overlap_and_names_its_kind() {
/// A text dialect renders the prompt catalogue and the harness clears
/// `request.tools`, so the bridge only reaches the model through the host's
-/// own catalogue. Without these entries the model reads a search result
-/// telling it to "invoke a match with `tool_call`" and has no signature for
-/// that name — observed live as a turn that narrates the call it is about to
-/// make and then stops.
+/// own catalogue. Without this entry the model has no signature for
+/// `tool_search` — observed live as a turn that narrates the call it is about
+/// to make and then stops. There is no `tool_call` wrapper: a found tool is
+/// called by its own name.
#[test]
-fn bridge_prompt_tools_advertise_search_and_call_when_something_is_deferred() {
+fn bridge_prompt_tools_advertise_only_search_when_something_is_deferred() {
let _g = guard();
apply_tool_search_config(&ToolSearchConfig::default());
let bridge = bridge_prompt_tools(12);
let names: Vec<&str> = bridge.iter().map(|t| t.name.as_ref()).collect();
- assert_eq!(names, vec!["tool_search", "tool_call"]);
+ assert_eq!(names, vec!["tool_search"]);
for tool in &bridge {
assert!(
tool.parameters_schema
diff --git a/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs b/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs
index 9f4988fc29..1b0f0d2a76 100644
--- a/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs
@@ -1,7 +1,7 @@
//! What ranks a `tool_search` in this process.
//!
//! The tinyagents harness owns tool discovery — the intrinsic `tool_search` /
-//! `tool_call` bridge over every `ToolExposure::Deferred` registration, a BM25
+//! bridge over every `ToolExposure::Deferred` registration (called by name once found), a BM25
//! catalogue, and a slot for a host ranker (`tool::discover`). This module is
//! the host's side of that slot: which [`ToolRanker`] the process installed
//! (a decision model such as Jev, installed by `openhuman-tinyhumans`; the
@@ -122,19 +122,17 @@ pub(crate) fn discovery_policy() -> ToolDiscoveryPolicy {
policy
}
-/// The `tool_search` / `tool_call` bridge, rendered for a TEXT dialect's
-/// prompt catalogue.
+/// The `tool_search` bridge, rendered for a TEXT dialect's prompt catalogue.
///
-/// The harness mints these two schemas onto `request.tools` whenever a run
-/// has a deferred catalogue, which is all a native-tool-calling provider
-/// needs. A text dialect (P-Format / code) never sees that set: the dialect
-/// folds the catalogue into the system prompt and clears `request.tools`,
-/// and because OpenHuman sets `host_renders_tool_catalogue` the harness
-/// appends nothing of its own. So on those dialects the bridge only reaches
-/// the model if the host's own catalogue carries it — otherwise the model
-/// reads "invoke a match with `tool_call`" in a search result naming a tool
-/// no signature in its catalogue describes, and answers with intent instead
-/// of a call.
+/// The harness mints this schema onto `request.tools` whenever a run has a
+/// deferred catalogue, which is all a native-tool-calling provider needs. A
+/// text dialect (P-Format / code) never sees that set: the dialect folds the
+/// catalogue into the system prompt and clears `request.tools`, and because
+/// OpenHuman sets `host_renders_tool_catalogue` the harness appends nothing of
+/// its own. So on those dialects the bridge only reaches the model if the
+/// host's own catalogue carries it — otherwise the model has no way to search
+/// for a tool that is not in its catalogue, and answers with intent instead of
+/// a call. A found tool is then called by its own name; there is no wrapper.
///
/// Built from [`tinyagents_harness::tool::discover::bridge_schemas`] rather
/// than hand-written prose, so the signature the model reads is the one
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs
index 2d6668e248..b115327752 100644
--- a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs
@@ -382,12 +382,12 @@ impl EventListener for OpenhumanEventBridge {
);
}
AgentEvent::DeferredToolCall { call_id, tool_name } => {
- // The following `ToolStarted` names the real tool; this only
- // records that it arrived through the bridge.
+ // The following `ToolStarted` names the same tool; this only
+ // records that it was not on the wire and was called by name.
tracing::debug!(
call_id = call_id.as_str(),
tool = tool_name.as_str(),
- "[tool-search] deferred tool invoked through tool_call"
+ "[tool-search] deferred tool invoked by name"
);
}
AgentEvent::ToolSearched {
diff --git a/crates/openhuman-core/src/tools/impl/meta/deferred.rs b/crates/openhuman-core/src/tools/impl/meta/deferred.rs
index 00208f4e33..94c7dc4368 100644
--- a/crates/openhuman-core/src/tools/impl/meta/deferred.rs
+++ b/crates/openhuman-core/src/tools/impl/meta/deferred.rs
@@ -12,7 +12,7 @@
//!
//! `Deferred` takes such a tool off the wire without removing the capability.
//! The tinyagents harness owns the other half of that bargain — the intrinsic
-//! `tool_search` / `tool_call` bridge, the BM25 catalogue, and the pluggable
+//! `tool_search` bridge, the BM25 catalogue, and the pluggable
//! ranker a decision model plugs into (`tool::discover`). This host used to
//! register a `tool_search` of its own, which the harness honoured over its
//! intrinsic; that tool could *find* a deferred tool but the turn allowlist
diff --git a/crates/openhuman-core/src/tools/ops.rs b/crates/openhuman-core/src/tools/ops.rs
index dcbbc93826..cfe38f757d 100644
--- a/crates/openhuman-core/src/tools/ops.rs
+++ b/crates/openhuman-core/src/tools/ops.rs
@@ -1072,9 +1072,9 @@ pub fn all_tools_with_runtime(
// through this function.
crate::tools::toolpacks::append_pack_tools(&mut tools);
// The lookup half of `ToolExposure::Deferred` is not registered here: the
- // tinyagents harness advertises its intrinsic `tool_search` / `tool_call`
- // bridge whenever a run has a deferred tool (`tool::discover`), ranked by
- // whatever `agent::tinyagents::discovery` installed. A host-registered
+ // tinyagents harness advertises its intrinsic `tool_search` bridge
+ // (a found tool is then called by its own name) whenever a run has a
+ // deferred tool (`tool::discover`), ranked by whatever `agent::tinyagents::discovery` installed. A host-registered
// `tool_search` would shadow that bridge.
tools
}
diff --git a/crates/openhuman-core/src/tools/ops_tests_catalog_fixture_tests.rs b/crates/openhuman-core/src/tools/ops_tests_catalog_fixture_tests.rs
index a59044a4a6..cdc7201a3b 100644
--- a/crates/openhuman-core/src/tools/ops_tests_catalog_fixture_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_catalog_fixture_tests.rs
@@ -87,13 +87,12 @@ fn full_product_features_enabled() -> bool {
/// build may register fewer tools, but every name it registers must be in
/// the product catalog. The full product build checks exact equality.
///
-/// On top of the domain registry this adds the two harness-intrinsic bridge
-/// tool names, `tool_search` and `tool_call`
-/// (`tinyagents_harness::tool::discover::{TOOL_SEARCH_NAME, TOOL_CALL_NAME}`):
-/// neither is ever a registered [`tinytools::Tool`] — the agent loop answers
-/// both itself once a turn has deferred tools (see that module's doc comment)
-/// — but both are model-visible tool names the frontend's tool-call
-/// presentation must recognize exactly like any other.
+/// On top of the domain registry this adds the harness-intrinsic bridge tool
+/// name, `tool_search` (`tinyagents_harness::tool::discover::TOOL_SEARCH_NAME`):
+/// it is never a registered [`tinytools::Tool`] — the agent loop answers it
+/// itself once a turn has deferred tools (see that module's doc comment) —
+/// but it is a model-visible tool name the frontend's tool-call presentation
+/// must recognize exactly like any other.
fn full_tool_catalog_names() -> Vec<String> {
let tmp = TempDir::new().unwrap();
let security = Arc::new(SecurityPolicy::default());
@@ -122,7 +121,6 @@ fn full_tool_catalog_names() -> Vec<String> {
let mut names: Vec<String> = tools.iter().map(|t| t.name().to_string()).collect();
names.push(tinyagents_harness::tool::discover::TOOL_SEARCH_NAME.to_string());
- names.push(tinyagents_harness::tool::discover::TOOL_CALL_NAME.to_string());
names.sort();
names.dedup();
// Defensive: a Composio per-connection action tool would be an
diff --git a/tests/agent_harness_e2e.rs b/tests/agent_harness_e2e.rs
index 6e5669340f..327fee09ee 100644
--- a/tests/agent_harness_e2e.rs
+++ b/tests/agent_harness_e2e.rs
@@ -4017,8 +4017,8 @@ async fn orchestrator_advertises_direct_mcp_tools_inner() {
stack.shutdown();
}
-/// Search discovers a connected MCP action with its schema, then `tool_call`
-/// invokes that action on the same orchestrator turn.
+/// Search discovers a connected MCP action with its schema, then the model
+/// calls that action by its own name on the same orchestrator turn.
#[cfg(feature = "mcp")]
#[test]
fn orchestrator_calls_a_connected_mcp_tool_directly() {
@@ -4049,13 +4049,7 @@ async fn orchestrator_calls_a_connected_mcp_tool_directly_inner() {
"tool_search",
json!({ "query": "echo message on my connected MCP server" }),
),
- tool_call_completion(
- "tool_call",
- json!({
- "name": action.clone(),
- "arguments": json!({ "message": MCP_ECHO_CANARY }).to_string()
- }),
- ),
+ tool_call_completion(&action, json!({ "message": MCP_ECHO_CANARY })),
text_completion("The MCP tool answered."),
]);
let mut events = spawn_sse_collector(format!(
@@ -4117,9 +4111,9 @@ async fn orchestrator_calls_a_connected_mcp_tool_directly_inner() {
let belt = advertised_tool_names(requests.first().expect("first model request"));
assert!(belt.iter().any(|name| name == "tool_search"));
assert!(!belt.iter().any(|name| name == &action));
- let result = tool_result_text(&requests, "tool_call").unwrap_or_else(|| {
+ let result = tool_result_text(&requests, &action).unwrap_or_else(|| {
panic!(
- "no tool result for MCP tool_call; requests: {}",
+ "no tool result for the MCP action call; requests: {}",
serde_json::to_string_pretty(&requests).unwrap_or_default()
)
});
diff --git a/vendor/tinyagents b/vendor/tinyagents
index 9d9cf25d5a..e602b65910 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit 9d9cf25d5af5c81fd991173494f9866077d806a9
+Subproject commit e602b65910f7a62d53258097ecac8fd5ae366730