Skip to content

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

refactor(attachments): thread inner model through provider wrappers

Steven Enamakel07a11f2ca379
diff --git a/crates/openhuman-core/src/attachments/provider.rs b/crates/openhuman-core/src/attachments/provider.rs
index 06ecdd8917..6f56190caf 100644
--- a/crates/openhuman-core/src/attachments/provider.rs
+++ b/crates/openhuman-core/src/attachments/provider.rs
@@ -14,6 +14,7 @@ use tinyinference_llm::{
pub(crate) fn wrap(
ctx: &crate::core::runtime::DispatchCtx,
+ inner: Arc<dyn ChatModel<()>>,
config: Arc<Config>,
model: &str,
provider: &str,
@@ -73,6 +74,7 @@ pub(crate) fn wrap(
/// Transport support is still required for every native media block.
pub(crate) fn wrap_injected(
ctx: &crate::core::runtime::DispatchCtx,
+ inner: Arc<dyn ChatModel<()>>,
config: Arc<Config>,
) -> Arc<dyn ChatModel<()>> {
let profile = inner.profile().cloned().unwrap_or_default();
diff --git a/crates/openhuman-core/src/attachments/provider_owner.rs b/crates/openhuman-core/src/attachments/provider_owner.rs
index a1d10f485e..128e5fe6bb 100644
--- a/crates/openhuman-core/src/attachments/provider_owner.rs
+++ b/crates/openhuman-core/src/attachments/provider_owner.rs
@@ -121,12 +121,13 @@ impl MediaSourceResolver<AttachmentAccessScope> for AttachmentModel {
mime,
});
if recovered {
- resolved = resolved.with_annotation(format!(
+ let annotation = format!(
"[Recovered attachment: {}; {} bytes; workspace path: {}]",
resolved.attachment.mime,
resolved.attachment.size_bytes,
resolved.attachment.name
- ));
+ );
+ resolved = resolved.with_annotation(annotation);
}
Ok(resolved)
}