Skip to content

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

feat(agent): add multimodal attachment support to agent sessions

Steven Enamakel63b9dcded67a
diff --git a/crates/openhuman-core/src/agent/attachments/mod.rs b/crates/openhuman-core/src/agent/attachments/mod.rs
index 752f0d0926..1a30451e5d 100644
--- a/crates/openhuman-core/src/agent/attachments/mod.rs
+++ b/crates/openhuman-core/src/agent/attachments/mod.rs
@@ -458,7 +458,8 @@ pub(crate) async fn has_resolvable_image(
) -> anyhow::Result<bool> {
let rehydrated = crate::agent::multimodal::rehydrate_image_placeholders(&[
tinyagents_session::transcript::TranscriptMessage::user(prompt),
- ]);
+ ])
+ .await;
let mut paths = parse(prompt)
.1
.into_iter()
diff --git a/crates/openhuman-core/src/agent/harness/graph.rs b/crates/openhuman-core/src/agent/harness/graph.rs
index 2e875210a3..acc396d9ef 100644
--- a/crates/openhuman-core/src/agent/harness/graph.rs
+++ b/crates/openhuman-core/src/agent/harness/graph.rs
@@ -125,7 +125,7 @@ pub(crate) async fn run_channel_turn_via_graph(
}
}
let prepared = if crate::agent::multimodal::has_image_placeholders(history) {
- crate::agent::multimodal::rehydrate_image_placeholders(history)
+ crate::agent::multimodal::rehydrate_image_placeholders(history).await
} else {
history.clone()
};
diff --git a/crates/openhuman-core/src/agent/multimodal.rs b/crates/openhuman-core/src/agent/multimodal.rs
index 8cabfcb679..4e7ac3eb5d 100644
--- a/crates/openhuman-core/src/agent/multimodal.rs
+++ b/crates/openhuman-core/src/agent/multimodal.rs
@@ -596,6 +596,7 @@ fn stash() -> Option<BlobAttachmentStash> {
fn memory_stash() -> &'static BlobAttachmentStash {
static MEMORY: OnceLock<BlobAttachmentStash> = OnceLock::new();
MEMORY.get_or_init(|| {
+ use tinystoragedrivers::StorageBackend as _;
let scoped = tinystoragedrivers::MemoryStorage::new()
.for_scope(&tinystoragedrivers::Scope::local())
.expect("the memory backend binds the local scope");
diff --git a/crates/openhuman-core/src/agent/session_host/driver.rs b/crates/openhuman-core/src/agent/session_host/driver.rs
index 28ffe38ac0..9469be05b6 100644
--- a/crates/openhuman-core/src/agent/session_host/driver.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver.rs
@@ -146,7 +146,7 @@ impl SessionDriver<OpenHumanRunContext> for OpenHumanSessionDriver {
.filter_map(tinyagents_runtime::transcript::message_to_native_transcript)
.collect();
if crate::agent::multimodal::has_image_placeholders(&messages) {
- messages = crate::agent::multimodal::rehydrate_image_placeholders(&messages);
+ messages = crate::agent::multimodal::rehydrate_image_placeholders(&messages).await;
}
// Runtime's `ToolSnapshot` remains the model declaration and final
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
index 235cb2f089..ad35e93a05 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
@@ -146,7 +146,7 @@ pub(in super::super) async fn run_subagent_via_graph(
// (BYOK/custom). The expanded copy is provider-only — the persisted `history`
// written back below keeps the original markers.
let dispatch_history = if crate::agent::multimodal::has_image_placeholders(history) {
- crate::agent::multimodal::rehydrate_image_placeholders(history)
+ crate::agent::multimodal::rehydrate_image_placeholders(history).await
} else {
history.clone()
};