Skip to content

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

chore: files changed crates/openhuman-core/src/search/README.md,crates/openhuman-core/src/search/eng

Steven Enamakeld67a276146ec
diff --git a/crates/openhuman-core/src/search/README.md b/crates/openhuman-core/src/search/README.md
index c5c44aae86..6f989a7b99 100644
--- a/crates/openhuman-core/src/search/README.md
+++ b/crates/openhuman-core/src/search/README.md
@@ -32,23 +32,28 @@ When search is disabled, search tools are absent from the agent runtime tool lis
- `tools/mod.rs:47` re-exports `crate::search::tools::*`, so callers reach
search tools through `crate::tools` rather than importing `crate::search`
directly.
-- TinyFish tools are not tied to `search.engine`: `registry.rs` pushes them
- whenever `config.integrations.tinyfish.is_active()`, on top of whichever
- engine is active.
+- TinyFish tools are not selected by `search.engine`: `registry.rs`
+ (`build_backend_search_tools`) pushes them on top of whichever engine is
+ active when the engine is not `disabled`, an `IntegrationClient` can be
+ built, and `config.integrations.tinyfish.is_active()`.
- `SearxngSearchTool` and `SeltzSearchTool` bypass the engine registry
- entirely. They are constructed per-request by the `tools_searxng_search`
- (`tools/schemas_part_02.rs:41`) and `tools_seltz_search`
- (`tools/schemas_part_01.rs:555`) RPC handlers, using arguments from the RPC
- call rather than saved `Config.search` state.
+ entirely. They are constructed per call by the `tools.searxng_search`
+ (`tools/schemas_part_02.rs:41`) and `tools.seltz_search`
+ (`tools/schemas_part_01.rs:555`) RPC handlers, which take the query from the
+ RPC params and the endpoint, key, timeout, and `enabled` gate from the
+ top-level `config.searxng` / `config.seltz` sections, not `Config.search`.
## `engines/`
`engines` is `pub(crate)`. Each file (`managed`, `parallel`, `brave`,
`querit`, `exa`, `tavily`, `disabled`) exports a single
`pub(crate) fn build(root_config: &Config, params: SearchToolParams) -> Vec<Box<dyn Tool>>`
-that constructs that engine's tool set — e.g. `managed::build` wraps a single
-`WebSearchTool` pointed at the backend-proxied `web_search` endpoint.
-`registry.rs` matches `search.effective_engine()` to pick exactly one.
+that constructs that engine's tool set — e.g. `managed::build` returns a single
+`WebSearchTool`, which posts to the backend's
+`/agent-integrations/parallel/search`. `parallel::build` registers the same
+`WebSearchTool` alongside the Parallel family, and falls back to it alone when
+no backend client is available. `registry.rs` matches
+`search.effective_engine()` to pick exactly one.
See [`tools/README.md`](tools/README.md) for the provider -> tool -> transport
table, and
diff --git a/crates/openhuman-core/src/search/engines/mod.rs b/crates/openhuman-core/src/search/engines/mod.rs
index eb51a6fb3e..a7011e3e2a 100644
--- a/crates/openhuman-core/src/search/engines/mod.rs
+++ b/crates/openhuman-core/src/search/engines/mod.rs
@@ -1,4 +1,6 @@
-//! One `pub(crate) fn build(&Config, SearchToolParams) -> Vec<Box<dyn Tool>>` per search engine; `registry::build_search_tools` dispatches to exactly one based on `search.effective_engine()`.
+//! One `pub(crate) fn build(&Config, SearchToolParams) -> Vec<Box<dyn Tool>>`
+//! per search engine; `registry::build_search_tools` dispatches to exactly one
+//! based on `search.effective_engine()`.
pub(crate) mod brave;
pub(crate) mod disabled;
diff --git a/crates/openhuman-core/src/search/tools/README.md b/crates/openhuman-core/src/search/tools/README.md
index 09f03930f5..3e8571e414 100644
--- a/crates/openhuman-core/src/search/tools/README.md
+++ b/crates/openhuman-core/src/search/tools/README.md
@@ -16,7 +16,7 @@ provider family; `mod.rs` re-exports the full public surface with
| `seltz.rs` | `SeltzSearchTool` | `seltz_search` | Direct to `api.seltz.ai`, `x-api-key` header |
| `tavily.rs` (+ `tavily_part_01.rs`, `tavily_part_02.rs`) | `TavilySearchTool`, `TavilyExtractTool` | `tavily_search` or `web_search_tool` (constructor-selected), `tavily_extract` | BYOK, direct to `api.tavily.com`, `Authorization: Bearer` header — never proxied |
| `tinyfish.rs` | `TinyFishSearchTool`, `TinyFishFetchTool`, `TinyFishAgentRunTool` | `tinyfish_search`, `tinyfish_fetch`, `tinyfish_agent_run` | Backend-proxied via `IntegrationClient` (`/agent-integrations/tinyfish/*`); search/fetch are read-oriented, agent-run drives goal-based browser automation |
-| `web_search.rs` | `WebSearchTool` (+ crate-internal `resolve_managed_provider`) | `web_search_tool` | Backend-proxied managed search; resolves the actual provider (Exa by default) from the backend response for UI attribution |
+| `web_search.rs` | `WebSearchTool` (+ crate-internal `resolve_managed_provider`) | `web_search_tool` | Backend-proxied managed search (`POST /agent-integrations/parallel/search` via `IntegrationClient`); `resolve_managed_provider` labels the response with the provider the backend reports, falling back to `Exa`, for UI attribution. `with_direct_search(Option<SeltzSearchTool>)` can short-circuit the proxy, but only `web_search_tests.rs` uses it |
Several providers construct their primary tool with a `tool_name` field so the
same struct can register under either its own name (e.g. `exa_search`,
@@ -27,21 +27,28 @@ that engine is the active `search.engine` — see `exa.rs`, `querit.rs`, and
## Registration
Most families are selected by `search::registry::build_search_tools` based on
-`Config.search.engine`, via `search/engines/`
+`Config.search.effective_engine()`, via `search/engines/`
([README](../README.md)). `tinyfish.rs` tools are pushed separately by
-`registry.rs` whenever `config.integrations.tinyfish.is_active()`, independent
-of the chosen search engine.
+`registry.rs` (`build_backend_search_tools`) on top of whichever engine is
+active, provided the engine is not `disabled`, an `IntegrationClient` can be
+built (user signed in), and `config.integrations.tinyfish.is_active()`.
`SearxngSearchTool` and `SeltzSearchTool` are not reachable through the engine
-registry at all — they are constructed directly by the `tools_searxng_search`
-(`tools/schemas_part_02.rs:41`) and `tools_seltz_search`
-(`tools/schemas_part_01.rs:555`) RPC handlers, one call at a time, from
-per-request arguments rather than saved config. `SEARXNG_MAX_RESULTS` and
-`normalize_categories` are also reused by `mcp/server/tools/` to keep the MCP
-SearXNG surface consistent with the RPC handler.
+registry at all — they are constructed per call by the `tools.searxng_search`
+(`handle_searxng_search`, `tools/schemas_part_02.rs:41`) and
+`tools.seltz_search` (`handle_seltz_search`, `tools/schemas_part_01.rs:555`)
+RPC handlers. Those handlers take the query and `max_results` from the RPC
+params but read endpoint, key, timeout, and the `enabled` gate from the
+top-level `config.searxng` / `config.seltz` sections, not from
+`Config.search`. `SEARXNG_MAX_RESULTS` and `normalize_categories` are also
+reused by `mcp/server/tools/` to keep the MCP SearXNG surface consistent with
+the RPC handler.
## Tests
Each provider has a sibling `*_tests.rs` (`brave_tests.rs`, `exa_tests.rs`,
-etc.) wired in via `#[cfg(test)] mod tests;`. Tests that need a backend use the
-shared mock backend described in `AGENTS.md`, not real network calls.
+etc.) wired in via `#[cfg(test)] #[path = "<provider>_tests.rs"] mod tests;`.
+No test hits the network: `web_search_tests.rs` starts an in-process axum
+router (`start_mock_backend`) and points an `IntegrationClient` at it; the
+other backend-proxied families build their client against an unreachable
+`http://test` base and only exercise schema and response parsing.
diff --git a/crates/openhuman-core/src/search/tools/web_search.rs b/crates/openhuman-core/src/search/tools/web_search.rs
index 5a0226cdb3..6a787eecdd 100644
--- a/crates/openhuman-core/src/search/tools/web_search.rs
+++ b/crates/openhuman-core/src/search/tools/web_search.rs
@@ -1,10 +1,13 @@
//! `WebSearchTool` — the managed, backend-proxied `web_search_tool`.
//!
-//! Used when `search.engine = "managed"` (the default and the fallback when a
-//! BYOK engine has no key configured). Requests go through
-//! `crate::integrations::IntegrationClient`; `resolve_managed_provider`
-//! attributes each response to the provider the backend actually used
-//! (Exa today) for UI display.
+//! Registered by `engines/managed.rs` (the effective default, and the fallback
+//! when a BYOK engine has no key configured) and alongside the Parallel family
+//! by `engines/parallel.rs`. Requests go through
+//! `crate::integrations::IntegrationClient` to
+//! `POST /agent-integrations/parallel/search`; `resolve_managed_provider`
+//! attributes each response to the provider the backend reports, falling back
+//! to `MANAGED_DEFAULT_PROVIDER`, for UI display. `with_direct_search` can
+//! swap in a `SeltzSearchTool` that bypasses the proxy; only tests use it.
use super::{SearchResponse, SearchResultItem, SeltzSearchTool};
use crate::config::Config;