Skip to content

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

feat(tinybox): add docker status and cleanup calls

Steven Enamakelb480465eec1f
diff --git a/crates/openhuman-core/src/modules/tinybox.rs b/crates/openhuman-core/src/modules/tinybox.rs
index 4899ea9556..f679c03a89 100644
--- a/crates/openhuman-core/src/modules/tinybox.rs
+++ b/crates/openhuman-core/src/modules/tinybox.rs
@@ -49,6 +49,8 @@ const READ_OUTPUT: &str = contract::METHODS[24];
const RELEASE_OUTPUT: &str = contract::METHODS[25];
const START_JAILED_EXEC: &str = contract::METHODS[26];
const RUN_DOCKER: &str = contract::METHODS[27];
+const DOCKER_STATUS: &str = contract::METHODS[28];
+const CLEANUP_DOCKER: &str = contract::METHODS[29];
const DOCKER_CALL_GRACE: Duration = Duration::from_secs(5);
#[cfg(test)]
@@ -176,6 +178,22 @@ pub async fn run_docker(
call_run_docker_with_client(&client, request).await
}
+/// Probe the Docker daemon owned by the TinyBox module host.
+pub async fn docker_status(
+ config: &Config,
+ request: contract::DockerStatusRequest,
+) -> Result<contract::DockerStatus, String> {
+ call(config, DOCKER_STATUS, (request,), false).await
+}
+
+/// Stop TinyBox-owned containers matching the supplied label.
+pub async fn cleanup_docker(
+ config: &Config,
+ request: contract::CleanupDockerRequest,
+) -> Result<contract::CleanupDockerOutput, String> {
+ call(config, CLEANUP_DOCKER, (request,), false).await
+}
+
async fn call_run_docker_with_client(
client: &ModuleClient,
request: contract::DockerRunRequest,