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
fix(tokenjuice): accept canonical artifact dir in lexical path gate
Steven Enamakelb6a3eff9ade6
diff --git a/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs b/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rsindex e65415e278..9e54c9302e 100644--- a/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs+++ b/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs@@ -238,11 +238,23 @@ pub(crate) fn read_tool_result_artifact(_ => return Err(artifact_refused("that path is not a tool-result artifact")),}};- if !resolved.starts_with(dir) {+ // The lexical gate accepts either spelling of `dir`: the store may hand+ // out the canonical path (macOS `/var` -> `/private/var`) while `dir` is+ // configured through a symlinked component. The canonical containment+ // check below is what actually enforces the boundary.+ let canonical_dir = std::fs::canonicalize(dir).ok();+ let lexically_inside = resolved.starts_with(dir)+ || canonical_dir+ .as_deref()+ .is_some_and(|canonical_dir| resolved.starts_with(canonical_dir));+ if !lexically_inside {return Err(artifact_refused("that path is not a tool-result artifact"));}let not_found = |_| artifact_refused("that artifact no longer exists");- let canonical_dir = std::fs::canonicalize(dir).map_err(not_found)?;+ let canonical_dir = match canonical_dir {+ Some(canonical_dir) => canonical_dir,+ None => std::fs::canonicalize(dir).map_err(not_found)?,+ };let canonical = std::fs::canonicalize(&resolved).map_err(not_found)?;if !canonical.starts_with(&canonical_dir) {return Err(artifact_refused(