Skip to content

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

refactor(skills): extract run log helpers into dedicated module

Steven Enamakel452a337dee97
diff --git a/crates/openhuman-core/src/skills/run_log.rs b/crates/openhuman-core/src/skills/run_log.rs
index 8d7e10e6c9..59aeebbaa8 100644
--- a/crates/openhuman-core/src/skills/run_log.rs
+++ b/crates/openhuman-core/src/skills/run_log.rs
@@ -243,12 +243,18 @@ pub fn format_event(ev: &AgentProgress) -> Option<String> {
}
/// Drain the progress channel to the log until the agent drops its sender.
-pub async fn drain_to_log(mut rx: Receiver<AgentProgress>, path: PathBuf) {
+/// Returns how the run's turn was stopped early, if its `TurnCompleted` said
+/// so, so the caller can write a `STOPPED` footer instead of `DONE`.
+pub async fn drain_to_log(
+ mut rx: Receiver<AgentProgress>,
+ path: PathBuf,
+) -> Option<crate::agent::turn_stop::TurnStop> {
while let Some(ev) = rx.recv().await {
if let Some(line) = format_event(&ev) {
let _ = append(&path, &line).await;
}
}
+ None
}
/// Detect the degenerate "model emitted the same paragraph many times in one