Skip to content

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

feat(tinyagents): add raw_fetches field to middleware contexts

Steven Enamakel16daec2df845
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs
index 5a03a0f39d..eaa1c87903 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs
@@ -24,6 +24,7 @@ async fn same_tool_calls_persist_artifacts_under_distinct_call_ids() {
runtime_config: None,
tool_policies: HashMap::new(),
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
};
let mut ctx = context();
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
index aeea16e757..dbf9869d2d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
@@ -434,6 +434,7 @@ impl TurnContextMiddleware {
runtime_config: self.runtime_config,
tool_policies,
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
}));
}
// Push the handoff LAST (so its `after_tool` runs FIRST): it observes the
@@ -475,6 +476,7 @@ impl HandoffMiddleware {
agent_id: config.agent_id,
task_id: config.task_id,
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
}
}
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs
index bda04f6f61..a4a19ad731 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs
@@ -461,6 +461,7 @@ async fn tool_output_truncates_over_the_flat_budget() {
runtime_config: None,
tool_policies: HashMap::new(),
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
};
let mut result = tool_result("echo", &"x".repeat(5_000));
mw.after_tool(
@@ -494,6 +495,7 @@ async fn tool_output_leaves_small_results_untouched() {
runtime_config: None,
tool_policies: HashMap::new(),
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
};
let mut result = tool_result("echo", "tiny");
mw.after_tool(
@@ -534,6 +536,7 @@ fn tool_char_cap_reads_the_tools_own_declared_cap() {
runtime_config: None,
tool_policies,
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
};
// Tool declares its own char cap → surfaced for the per-tool truncation.
assert_eq!(mw.tool_char_cap("big"), Some(10));
@@ -583,6 +586,7 @@ async fn a_tool_that_caps_itself_is_never_sent_to_the_summarizer() {
runtime_config: None,
tool_policies,
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
};
let mut result = tool_result("terse", &"payload ".repeat(200));
@@ -633,6 +637,7 @@ async fn tool_output_honors_a_tools_own_cap() {
runtime_config: None,
tool_policies,
artifact_reads: Default::default(),
+ raw_fetches: Default::default(),
};
let mut result = tool_result("capped", &"y".repeat(500));
mw.after_tool(