Skip to content

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

fix(agent): a missing file is a wrong path from any tool, not a missing program

sanil-235e1c9615bba8
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
index 5f3050e524..228ef7588f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
@@ -368,8 +368,12 @@ pub(super) fn recovery_policy(
// program: the classifier files `No such file or directory (os error 2)`
// under `MissingApp`, which is right for a shell command and fatal for
// `file_read`. One bad relative path ended a whole turn after two calls.
+ // Any tool, not only the file tools: `use_skill` forwarding a screenshot
+ // from a path that did not exist ("image forwarding failed: Failed to
+ // resolve path …: No such file or directory") halted a one-hour task after
+ // 92 seconds. A shell command's own "No such file" arrives as an exit
+ // report, which never reaches this table.
if class == "unsupported"
- && is_path_tool(tool)
&& error
.to_ascii_lowercase()
.contains("no such file or directory")
@@ -420,14 +424,6 @@ fn is_optional_service(tool: &str) -> bool {
)
}
-/// Tools whose first argument is a filesystem path the model typed.
-fn is_path_tool(tool: &str) -> bool {
- matches!(
- tool,
- "file_read" | "file_write" | "apply_patch" | "list_files" | "list" | "grep" | "glob"
- )
-}
-
fn classified_recovery_policy(
tool: &str,
error: &str,
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs
index 104dcae949..9ecd17f638 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs
@@ -459,6 +459,34 @@ fn an_unknown_tool_is_a_correctable_call_not_a_blocker() {
);
}
+#[tokio::test]
+async fn a_missing_file_from_any_tool_is_a_correctable_call() {
+ // install-windows-3.11, 2026-10-08: the agent dumped a QEMU screenshot to
+ // one path and asked the vision skill to read it from another; the
+ // "No such file or directory" was filed under `unsupported` (zero
+ // retries) and the turn ended 92 s into an hour.
+ let error = "image forwarding failed: Failed to resolve path '/app/qemu-shots/screen1.png': No such file or directory (os error 2)";
+ assert_eq!(
+ super::super::repeated_failure::recovery_policy("use_skill", error, false),
+ Some(("not_found", 1))
+ );
+ let handle = SteeringHandle::allow_all();
+ let slot = std::sync::Arc::new(std::sync::Mutex::new(None));
+ let mw = RepeatedToolFailureMiddleware::new(handle.clone(), 3, slot.clone());
+ let mut call = TaToolCall::new(
+ "skill-1",
+ "use_skill",
+ serde_json::json!({"skill": "media", "args": {"image_paths": ["qemu-shots/screen1.png"]}}),
+ );
+ mw.before_tool(&mut ctx(), &(), &mut call).await.unwrap();
+ let mut result = failing_result("use_skill", error);
+ mw.after_tool(&mut ctx(), &(), &invocation("skill-1", "use_skill"), &mut result)
+ .await
+ .unwrap();
+ assert_eq!(drain_pause_count(&handle), 0, "one wrong path never halts");
+ assert!(slot.lock().unwrap().is_none());
+}
+
#[test]
fn a_mistyped_file_path_is_a_correctable_call_not_a_missing_program() {
let error = "Failed to resolve path 'mailbox/2026-09-18-flight.txt': No such file or directory (os error 2)";