Skip to content

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

fix(middleware): remove remote fetch permission retry logic

Steven Enamakel31cea1428c7a
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 eadc17917e..d01db90b03 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
@@ -247,12 +247,6 @@ pub(super) fn recovery_policy(
{
return Some(("not_found", 1));
}
- // A site refusing one URL (401/403/forbidden) is that site's answer, not a
- // broken credential the run cannot work around. The scope key is per URL,
- // so one retry on the same URL and free choice of every other source.
- if matches!(class, "authentication" | "permission") && is_remote_fetch_tool(tool) {
- return Some(("permission", 1));
- }
Some((class, budget))
}
@@ -264,11 +258,6 @@ fn is_path_tool(tool: &str) -> bool {
)
}
-/// Tools that fetch an arbitrary third-party URL on the model's behalf.
-fn is_remote_fetch_tool(tool: &str) -> bool {
- matches!(tool, "http_request" | "web_fetch")
-}
-
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 90f8ac93c8..f4f3322e45 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
@@ -338,21 +338,3 @@ fn a_mistyped_file_path_is_a_correctable_call_not_a_missing_program() {
Some(("unsupported", 0))
);
}
-
-#[test]
-fn a_site_refusing_one_url_does_not_halt_the_run() {
- for tool in ["http_request", "web_fetch"] {
- for error in ["HTTP 403 Forbidden", "status=401 Unauthorized"] {
- assert_eq!(
- super::super::repeated_failure::recovery_policy(tool, error, false),
- Some(("permission", 1)),
- "{tool}: {error}"
- );
- }
- }
- // The same status from a connector action is still a credential problem.
- assert_eq!(
- super::super::repeated_failure::recovery_policy("gmail_send", "HTTP 403 Forbidden", false),
- Some(("authentication", 0))
- );
-}