Skip to content

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

refactor(tinyagents): split halt cause lookup from failure recording

Steven Enamakelb74f98a2b967
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 c4178739f1..4253ce16b2 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
@@ -397,9 +397,8 @@ impl FailureScopePolicy<OpenHumanRunContext> for HostFailurePolicy {
fn record_guard_refusal(
&self,
_ctx: &RunContext<OpenHumanRunContext>,
- ) -> Option<tinyagents_harness::no_progress::ClassifiedStopCause> {
+ ) {
self.stop.record_refusal();
- self.stop.current_classified_cause()
}
fn record_progress(
@@ -407,12 +406,18 @@ impl FailureScopePolicy<OpenHumanRunContext> for HostFailurePolicy {
ctx: &RunContext<OpenHumanRunContext>,
_call: &TaToolCall,
_scope: &FailureScope,
- ) -> Option<tinyagents_harness::no_progress::ClassifiedStopCause> {
+ ) {
self.stop.record_success();
self.last_exit_report
.lock()
.unwrap_or_else(|p| p.into_inner())
.remove(&ctx.instance_id());
+ }
+
+ fn current_halt_cause(
+ &self,
+ _ctx: &RunContext<OpenHumanRunContext>,
+ ) -> Option<tinyagents_harness::no_progress::ClassifiedStopCause> {
self.stop.current_classified_cause()
}
@@ -462,12 +467,11 @@ impl FailureScopePolicy<OpenHumanRunContext> for HostFailurePolicy {
call: &TaToolCall,
repeated: bool,
error: &str,
- ) -> Option<tinyagents_harness::no_progress::ClassifiedStopCause> {
+ ) {
self.stop
.record_classified_halt(summary.to_owned(), class, &call.name, repeated, || {
first_error_line(error)
});
- self.stop.current_classified_cause()
}
fn finish_run(&self, ctx: &RunContext<OpenHumanRunContext>) {