Skip to content

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

feat(embed): expose awaited cleanup for host lifecycle commands

Steven Enamakelf45bb828a1ab
diff --git a/crates/openhuman-embed/src/process.rs b/crates/openhuman-embed/src/process.rs
index 02819ca1ba..f5c3733079 100644
--- a/crates/openhuman-embed/src/process.rs
+++ b/crates/openhuman-embed/src/process.rs
@@ -11,6 +11,10 @@ use std::path::{Path, PathBuf};
pub use openhuman_core::core::runtime::{AGENT_WORKER_STACK_BYTES, MAX_BLOCKING_THREADS};
+/// Scoped ownership for host commands outside an agent turn. After dropping
+/// the scoped future, await `wait()` before acknowledging cancellation.
+pub use openhuman_core::tools::timeout::ProcessCleanup as CommandCleanup;
+
#[cfg(feature = "crash-reporting")]
#[path = "process_sentry.rs"]
pub mod sentry;
diff --git a/crates/openhuman-embed/tests/process_cancellation.rs b/crates/openhuman-embed/tests/process_cancellation.rs
index ebbb932d16..e7aa730509 100644
--- a/crates/openhuman-embed/tests/process_cancellation.rs
+++ b/crates/openhuman-embed/tests/process_cancellation.rs
@@ -203,7 +203,7 @@ async fn host_commands_receive_stdin_and_timeout_after_reaping() {
let pidfile = scratch.path().join("host.pid");
let mut cmd = tokio::process::Command::new("/bin/sh");
cmd.args(["-c", &format!("echo $$ > {}; sleep 30", pidfile.display())]);
- let outer = ProcessCleanup::default();
+ let outer = openhuman_embed::process::CommandCleanup::default();
let result = outer
.scope(openhuman_embed::process::command_output(
&mut cmd,