Skip to content

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

fix(orchestration): remove unused research budget middleware

Steven Enamakel062407d5afee
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs
index 73b6086705..82700ee189 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs
@@ -10,7 +10,7 @@ impl Tool for SpawnSubagentTool {
per call: by default it runs as a reusable async worker and returns \
immediately — pass `blocking: true` to run it inline and get the \
sub-agent's final output back in this turn. To run several independent \
- workers at once (e.g. \"a separate researcher for each X\", a council \
+ workers at once (e.g. \"a separate worker for each X\", a council \
of opinions, or \"fan out over N items\"), use `spawn_parallel_agents` \
with one task per worker — a SINGLE call that launches them \
concurrently. Do NOT call this tool in a loop to fan out: repeated \
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
index 752b6b5889..b2b39a987c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
@@ -578,8 +578,8 @@ pub(super) fn assemble_turn_harness(
// Direct web lookup is for a bounded answer. Once enough search/fetch
// results have returned, spend the next model call on synthesis rather
- // than another variation of the same query. Specialist research runs keep
- // their own budgets and are not narrowed here.
+ // than another variation of the same query. Sub-agent runs keep their own
+ // budgets and are not narrowed here.
if subagent_scope.is_none() {
harness.push_middleware(Arc::new(middleware::ResearchBudgetMiddleware::new()));
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/research_budget.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/research_budget.rs
index 511ff26e1a..ee18744127 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/research_budget.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/research_budget.rs
@@ -13,8 +13,9 @@ use tinytools::ToolResult;
use crate::agent::tinyagents::host::OpenHumanRunContext;
/// Direct web reads allowed before the next model call must conclude the turn.
-/// Broad research can use the dedicated research agent; this bounds the master
-/// agent's exploratory search while leaving room to read primary sources.
+/// This bounds the master agent's exploratory search while leaving room to read
+/// primary sources; broad research belongs in one deep `web_answer_tool` call or
+/// a batched `web_contents_tool` read, each of which counts once.
pub(super) const DIRECT_WEB_READ_LIMIT: usize = 8;
const RESEARCH_CLOSE_INSTRUCTION: &str = "The direct web research budget for this turn is exhausted. Answer the user's latest request now using the results already available. State any remaining uncertainty. Do not search again, repeat a page fetch, or merely describe what you plan to read.";