Skip to content

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

feat(media): make video wait policy configurable in media tools

Steven Enamakelaab1bc2e0388
diff --git a/crates/openhuman-core/src/media/generation/tools.rs b/crates/openhuman-core/src/media/generation/tools.rs
index da5cd89cb8..ae7b8f98bb 100644
--- a/crates/openhuman-core/src/media/generation/tools.rs
+++ b/crates/openhuman-core/src/media/generation/tools.rs
@@ -48,15 +48,22 @@ pub fn build_media_tools(root_config: &Config, action_dir: &Path) -> Vec<Box<dyn
let Some(generators) = managed_generators(root_config) else {
return Vec::new();
};
- media_tools_from(generators, action_dir, &root_config.workspace_dir)
+ media_tools_from(
+ generators,
+ action_dir,
+ &root_config.workspace_dir,
+ WaitPolicy::new(VIDEO_POLL_INTERVAL, VIDEO_WAIT_BUDGET),
+ )
}
/// Builds the tool set over any generators (the managed ones in production,
-/// mocks in tests), writing under `action_dir`.
+/// mocks in tests), writing under `action_dir`; `video_wait` bounds each
+/// video job.
pub fn media_tools_from(
generators: MediaGenerators,
action_dir: &Path,
workspace_dir: &Path,
+ video_wait: WaitPolicy,
) -> Vec<Box<dyn Tool>> {
let MediaGenerators { image, video } = generators;
let output = MediaOutput::new(action_dir)
@@ -75,7 +82,7 @@ pub fn media_tools_from(
.with_description(VIDEO_DESCRIPTION)
.with_permission_level(PermissionLevel::Execute)
.with_category(ToolCategory::Workflow)
- .with_wait_policy(WaitPolicy::new(VIDEO_POLL_INTERVAL, VIDEO_WAIT_BUDGET)),
+ .with_wait_policy(video_wait),
),
Box::new(MediaListModelsTool { image, video }),
];
diff --git a/crates/openhuman-core/src/media/generation/tools_tests.rs b/crates/openhuman-core/src/media/generation/tools_tests.rs
index 5ed1164686..f4bfe4fe62 100644
--- a/crates/openhuman-core/src/media/generation/tools_tests.rs
+++ b/crates/openhuman-core/src/media/generation/tools_tests.rs
@@ -17,6 +17,10 @@ fn tools(action_dir: &Path) -> Vec<Box<dyn Tool>> {
},
action_dir,
&action_dir.join("workspace"),
+ tinyagents_harness::tinyinference_video::WaitPolicy::new(
+ std::time::Duration::from_millis(1),
+ std::time::Duration::from_secs(5),
+ ),
)
}