Skip to content

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

chore: reformat test code for readability

Steven Enamakelbbee1f5125e9
diff --git a/crates/openhuman-core/src/flows/ops_migration_deserialize_tests.rs b/crates/openhuman-core/src/flows/ops_migration_deserialize_tests.rs
index cf5d03e790..a67ff4cf1b 100644
--- a/crates/openhuman-core/src/flows/ops_migration_deserialize_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_migration_deserialize_tests.rs
@@ -32,6 +32,9 @@ fn migrate_and_deserialize_graph_reports_a_non_object_graph_without_inventing_a_
let err = migrate_and_deserialize_graph(json!("this is a string, not a workflow graph"))
.expect_err("a non-object graph must not deserialize");
assert!(!err.contains('['), "got: {err}");
- assert!(!err.contains(": invalid") || !err.starts_with("name"), "got: {err}");
+ assert!(
+ !err.contains(": invalid") || !err.starts_with("name"),
+ "got: {err}"
+ );
assert!(err.contains("invalid type"), "got: {err}");
}
diff --git a/crates/openhuman-core/src/threads/transcript_view/transcript_view_subagent_tests.rs b/crates/openhuman-core/src/threads/transcript_view/transcript_view_subagent_tests.rs
index 81935b52d6..4e5b97cd86 100644
--- a/crates/openhuman-core/src/threads/transcript_view/transcript_view_subagent_tests.rs
+++ b/crates/openhuman-core/src/threads/transcript_view/transcript_view_subagent_tests.rs
@@ -5,33 +5,60 @@ fn subagent_anchors_to_parent_turn_by_spawn_timestamp() {
let dir = TempDir::new().unwrap();
let root_stem = "800_orchestrator";
let thread_id = "thr_anchor";
- let t1 = chrono::DateTime::from_timestamp(1_000_000, 0).unwrap().to_rfc3339();
- let t2 = chrono::DateTime::from_timestamp(2_000_000, 0).unwrap().to_rfc3339();
+ let t1 = chrono::DateTime::from_timestamp(1_000_000, 0)
+ .unwrap()
+ .to_rfc3339();
+ let t2 = chrono::DateTime::from_timestamp(2_000_000, 0)
+ .unwrap()
+ .to_rfc3339();
let root_body = vec![
r#"{"role":"user","content":"one","request_id":"req-1"}"#.to_string(),
- format!(r#"{{"role":"assistant","content":"a1","provider":"anthropic","model":"m","usage":{{"input":1,"output":1,"cached_input":0,"cost_usd":0.0}},"ts":"{t1}","iteration":1,"request_id":"req-1"}}"#),
+ format!(
+ r#"{{"role":"assistant","content":"a1","provider":"anthropic","model":"m","usage":{{"input":1,"output":1,"cached_input":0,"cost_usd":0.0}},"ts":"{t1}","iteration":1,"request_id":"req-1"}}"#
+ ),
r#"{"role":"user","content":"two","request_id":"req-2"}"#.to_string(),
- format!(r#"{{"role":"assistant","content":"a2","provider":"anthropic","model":"m","usage":{{"input":1,"output":1,"cached_input":0,"cost_usd":0.0}},"ts":"{t2}","iteration":1,"request_id":"req-2"}}"#),
+ format!(
+ r#"{{"role":"assistant","content":"a2","provider":"anthropic","model":"m","usage":{{"input":1,"output":1,"cached_input":0,"cost_usd":0.0}},"ts":"{t2}","iteration":1,"request_id":"req-2"}}"#
+ ),
];
let root_refs: Vec<&str> = root_body.iter().map(String::as_str).collect();
write_raw(dir.path(), root_stem, thread_id, &root_refs);
- write_raw(dir.path(), &format!("{root_stem}__999950_coder"), thread_id, &[r#"{"role":"assistant","content":"coder work"}"#]);
- write_raw(dir.path(), &format!("{root_stem}__1000050_planner"), thread_id, &[r#"{"role":"assistant","content":"planner work"}"#]);
+ write_raw(
+ dir.path(),
+ &format!("{root_stem}__999950_coder"),
+ thread_id,
+ &[r#"{"role":"assistant","content":"coder work"}"#],
+ );
+ write_raw(
+ dir.path(),
+ &format!("{root_stem}__1000050_planner"),
+ thread_id,
+ &[r#"{"role":"assistant","content":"planner work"}"#],
+ );
let projected = project_thread(dir.path(), thread_id).expect("project thread");
- let mut anchors: Vec<(String, Option<String>)> = projected.items.iter().filter_map(|item| match item {
- DisplayItem::Subagent { request_id, items, .. } => {
- let marker = items.iter().find_map(|inner| match inner {
- DisplayItem::AssistantMessage { content, .. } => Some(content.clone()),
- _ => None,
- })?;
- Some((marker, request_id.clone()))
- }
- _ => None,
- }).collect();
+ let mut anchors: Vec<(String, Option<String>)> = projected
+ .items
+ .iter()
+ .filter_map(|item| match item {
+ DisplayItem::Subagent {
+ request_id, items, ..
+ } => {
+ let marker = items.iter().find_map(|inner| match inner {
+ DisplayItem::AssistantMessage { content, .. } => Some(content.clone()),
+ _ => None,
+ })?;
+ Some((marker, request_id.clone()))
+ }
+ _ => None,
+ })
+ .collect();
anchors.sort();
- assert_eq!(anchors, vec![
- ("coder work".to_string(), Some("req-1".to_string())),
- ("planner work".to_string(), Some("req-2".to_string())),
- ]);
+ assert_eq!(
+ anchors,
+ vec![
+ ("coder work".to_string(), Some("req-1".to_string())),
+ ("planner work".to_string(), Some("req-2".to_string())),
+ ]
+ );
}