Skip to content

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

test(subagent-host): read failed-run iteration from persisted usage

Steven Enamakel371c69b52a2c
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
index 55ace1efed..99c11ef581 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
@@ -140,16 +140,15 @@ async fn failed_subagent_run_keeps_its_unanswered_round_out_of_history() {
// Two model calls were answered before the rejection; the recorded
// iteration must say so rather than count persisted messages.
- let raw = std::fs::read_to_string(&path).expect("raw transcript");
- let marker_line = raw
- .lines()
- .filter_map(|line| serde_json::from_str::<serde_json::Value>(line).ok())
- .rfind(|line| line.get("role").and_then(|role| role.as_str()) == Some("assistant"))
- .expect("failure marker line");
+ let iteration = persisted
+ .messages
+ .last()
+ .and_then(|marker| marker.turn_usage.as_ref())
+ .map(|usage| usage.iteration);
assert_eq!(
- marker_line.get("iteration").and_then(|n| n.as_u64()),
+ iteration,
Some(2),
- "the failed run reports the model calls a provider answered: {marker_line}"
+ "the failed run reports the model calls a provider answered"
);
}
diff --git a/vendor/tinyagents b/vendor/tinyagents
index 9a5709519d..ef69312ce1 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit 9a5709519dac1c913bee10f76a2af9714f72487f
+Subproject commit ef69312ce18d55f9aae17500f26528fe7b9d8573