Skip to content

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

test(tinyagents): read persisted artifacts through the store

Steven Enamakelf56fa77efc3c
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 2a3bcd260e..981fe96fc3 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
@@ -11,15 +11,14 @@ fn context() -> RunContext<crate::agent::tinyagents::host::OpenHumanRunContext>
#[tokio::test]
async fn same_tool_calls_persist_artifacts_under_distinct_call_ids() {
let temp = tempfile::tempdir().expect("temporary artifact root");
+ let store = crate::agent::harness::tool_result_artifacts::in_memory_tool_result_store(
+ temp.path().to_path_buf(),
+ "identity-session",
+ );
let middleware = ToolOutputMiddleware {
budget_bytes: 8,
payload_summarizer: None,
- artifact_store: Some(
- crate::agent::harness::tool_result_artifacts::in_memory_tool_result_store(
- temp.path().to_path_buf(),
- "identity-session",
- ),
- ),
+ artifact_store: Some(store.clone()),
tokenjuice_compaction_enabled: false,
tokenjuice_compression: AgentTokenjuiceCompression::Off,
runtime_config: None,
@@ -46,13 +45,20 @@ async fn same_tool_calls_persist_artifacts_under_distinct_call_ids() {
.await
.expect("second artifact is persisted");
- let root = temp.path().join("tool-results/identity-session/echo");
assert_eq!(
- std::fs::read_to_string(root.join("echo-1.txt")).expect("first artifact"),
+ store
+ .read("tool-results/identity-session/echo/echo-1.txt")
+ .await
+ .unwrap()
+ .expect("first artifact"),
"first result is deliberately oversized"
);
assert_eq!(
- std::fs::read_to_string(root.join("echo-2.txt")).expect("second artifact"),
+ store
+ .read("tool-results/identity-session/echo/echo-2.txt")
+ .await
+ .unwrap()
+ .expect("second artifact"),
"second result is deliberately oversized"
);
}