Skip to content

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

fix(attachments): gate document text binding behind feature flag

Steven Enamakela0c150c18a99
diff --git a/crates/openhuman-core/src/agent/multimodal.rs b/crates/openhuman-core/src/agent/multimodal.rs
index d6a17cf635..cd8f538429 100644
--- a/crates/openhuman-core/src/agent/multimodal.rs
+++ b/crates/openhuman-core/src/agent/multimodal.rs
@@ -19,7 +19,6 @@ use crate::config::{
use tinyagents_session::transcript::{TranscriptMessage, TranscriptPart};
use tinyagents_harness::multimodal::{
- self as mm,
config::ImageLimits,
markers,
payload::sha256_prefix,
diff --git a/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs b/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
index 1b0f496098..305c7df43c 100644
--- a/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
+++ b/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
@@ -81,12 +81,13 @@ async fn sweep_keeps_fresh_attachments() {
.nth(1)
.and_then(|s| s.split(']').next())
.map(str::trim)
- .expect("placeholder carries an id");
+ .expect("placeholder carries an id")
+ .to_owned();
sweep_stale_attachments().await;
let index = build_attachment_index(&[TranscriptMessage::user(placeholdered)]).await;
- assert!(index.contains_key(id), "fresh attachment retained after sweep");
+ assert!(index.contains_key(&id), "fresh attachment retained after sweep");
}
#[test]
diff --git a/crates/openhuman-core/src/attachments/provider_fallback.rs b/crates/openhuman-core/src/attachments/provider_fallback.rs
index e75457eb91..dcb16f1e4b 100644
--- a/crates/openhuman-core/src/attachments/provider_fallback.rs
+++ b/crates/openhuman-core/src/attachments/provider_fallback.rs
@@ -10,8 +10,11 @@ impl AttachmentModel {
let mut cacheable = true;
#[cfg(not(feature = "documents"))]
let cacheable = false;
+ #[cfg(feature = "documents")]
let mut text = String::new();
#[cfg(not(feature = "documents"))]
+ let text = String::new();
+ #[cfg(not(feature = "documents"))]
let _ = (path, mime, bytes);
#[cfg(feature = "documents")]
{