Skip to content

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

test(tui): cover child thinking delta activity tracking

Steven Enamakel4f2a3d581790
diff --git a/crates/openhuman-tui/src/state_tests.rs b/crates/openhuman-tui/src/state_tests.rs
index 3d3175d413..32c5e77a52 100644
--- a/crates/openhuman-tui/src/state_tests.rs
+++ b/crates/openhuman-tui/src/state_tests.rs
@@ -381,6 +381,30 @@ fn child_activity_accumulates_output_and_failed_status_in_one_record() {
("subagent_spawned", None),
("subagent_text_delta", Some("partial")),
("subagent_failed", None),
+ ] {
+ state.apply_event(&ev(
+ event,
+ serde_json::json!({
+ "skill_id":"task","request_id":"turn","delta":delta,"message":"Timed out"
+ }),
+ ));
+ }
+ assert_eq!(state.entries().len(), 1);
+ let child = state.entries()[0].activity.as_ref().unwrap();
+ assert!(child.child);
+ assert_eq!(child.status, Status::Error);
+ assert_eq!(child.output, "partial");
+ assert!(child.details().contains("Timed out"));
+}
+
+#[test]
+fn child_thinking_delta_uses_nested_task_identity() {
+ let mut state = TranscriptState::new(CLIENT);
+ for (event, delta) in [
+ ("subagent_spawned", None),
+ ("subagent_text_delta", Some("partial")),
+ ("subagent_thinking_delta", Some("reasoning")),
+ ("subagent_failed", None),
] {
state.apply_event(&ev(
event,
@@ -395,7 +419,6 @@ fn child_activity_accumulates_output_and_failed_status_in_one_record() {
assert!(child.child);
assert_eq!(child.status, Status::Error);
assert_eq!(child.output, "partial");
- assert!(child.details().contains("Timed out"));
}
#[test]