The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
Revert "fix(tool-result artifacts): move artifact storage under a dedicated subdirectory"
Steven Enamakel77e0cc33a8eb
diff --git a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rsindex 15f773c206..34a2370395 100644--- a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs+++ b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs@@ -17,7 +17,10 @@ async fn threshold_persists_outside_the_project_and_reads_back() {let project = tmp.path().join("project");std::fs::create_dir_all(&workspace).unwrap();std::fs::create_dir_all(&project).unwrap();- let store = new_tool_result_store(workspace.join("artifacts"), "session/one");+ let store = new_tool_result_store(+ crate::security::policy::tool_result_artifacts_dir(&workspace),+ "session/one",+ );let raw = format!("{} {}","x".repeat(4096),diff --git a/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs b/crates/openhuman-core/src/agent/session_host/artifact_wiring.rsindex 67a98a6a78..c5bc27e2f3 100644--- a/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs+++ b/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs@@ -9,6 +9,7 @@ use std::path::{Path, PathBuf};use crate::agent::harness::tool_result_artifacts::{legacy_action_dir_store, new_tool_result_store,};+use crate::security::policy::tool_result_artifacts_dir;use tinyagents_harness::artifacts::tool_results::ToolResultArtifactStore;/// How long another session's tool-result artifacts survive before a laterdiff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rsindex 9beea3c371..4fb0740fcc 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@@ -45,7 +45,7 @@ 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");+ let root = temp.path().join("identity-session/echo");assert_eq!(std::fs::read_to_string(root.join("echo-1.txt")).expect("first artifact"),"first result is deliberately oversized"diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_artifact_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_artifact_tests.rsindex 6c88fb49ca..8392d28176 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_artifact_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_artifact_tests.rs@@ -69,7 +69,7 @@ async fn a_wrapped_read_of_a_persisted_artifact_is_paged_not_resummarized_or_rep&rendered[page_end..]);assert!(- !tmp.path().join("tool-results/session").exists(),+ !tmp.path().join("session").exists(),"reading an artifact must not persist it again as a new artifact");}@@ -79,10 +79,10 @@ async fn a_wrapped_read_of_a_persisted_artifact_is_paged_not_resummarized_or_rep#[tokio::test]async fn a_read_of_an_absolute_artifact_pointer_is_paged_not_repersisted() {let tmp = tempfile::tempdir().unwrap();- let storage = tmp.path();+ let storage = tmp.path().join("tool-results");let mw = artifact_mw(Some(summarized("SUMMARY")), &storage);let pointer = storage- .join("tool-results/session/shell/earlier.txt")+ .join("session/shell/earlier.txt").to_string_lossy().into_owned();let mut call = TaToolCall::new("c1", "file_read", json!({"path": pointer}));@@ -107,7 +107,7 @@ async fn a_read_of_an_absolute_artifact_pointer_is_paged_not_repersisted() {"the continuation must name the same absolute pointer: {rendered}");assert!(- !storage.join("tool-results/session/file_read").exists(),+ !storage.join("session/file_read").exists(),"reading an artifact must not persist it again as a new artifact");}@@ -131,8 +131,8 @@ async fn an_oversized_result_is_stored_as_the_tool_returned_it_not_as_rewritten("an over-budget result is persisted: {}",result_text(&result));- let stored = std::fs::read_to_string(tmp.path().join("tool-results/session/echo/c1.txt"))- .expect("artifact written");+ let stored =+ std::fs::read_to_string(tmp.path().join("session/echo/c1.txt")).expect("artifact written");assert_eq!(stored, raw,"the artifact must hold the tool's own output, not the rewritten copy"@@ -157,8 +157,8 @@ async fn a_raw_result_file_read_cannot_open_is_stored_as_the_processed_copy() {.0.unwrap();- let stored = std::fs::read_to_string(tmp.path().join("tool-results/session/echo/c1.txt"))- .expect("artifact written");+ let stored =+ std::fs::read_to_string(tmp.path().join("session/echo/c1.txt")).expect("artifact written");assert_eq!(stored, summary,"a raw body over file_read's limit would be unreadable, so the processed copy is stored"