Skip to content

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

fix(attachments): allow staged native attachment references

Steven Enamakel567fc3124da5
diff --git a/crates/openhuman-core/src/attachments/provider_owner.rs b/crates/openhuman-core/src/attachments/provider_owner.rs
index 201c17c1a9..c935a09216 100644
--- a/crates/openhuman-core/src/attachments/provider_owner.rs
+++ b/crates/openhuman-core/src/attachments/provider_owner.rs
@@ -105,15 +105,19 @@ impl MediaSourceResolver<AttachmentAccessScope> for AttachmentModel {
max_bytes: usize,
metadata: &MediaSourceMetadata,
) -> Result<ResolvedMedia, String> {
- if (metadata.kind == MediaSourceKind::Url
- && !source.starts_with("data:")
- && !source.starts_with("http://")
- && !source.starts_with("https://"))
- || (metadata.kind == MediaSourceKind::Untyped
+ // Staged native attachments are opaque host references that
+ // `resolve_block` authorizes against the thread, not URLs to fetch.
+ let staged = source.starts_with("openhuman-staged://");
+ if !staged
+ && ((metadata.kind == MediaSourceKind::Url
&& !source.starts_with("data:")
- && source.contains("://")
&& !source.starts_with("http://")
&& !source.starts_with("https://"))
+ || (metadata.kind == MediaSourceKind::Untyped
+ && !source.starts_with("data:")
+ && source.contains("://")
+ && !source.starts_with("http://")
+ && !source.starts_with("https://")))
{
return Err("unsupported media URL scheme".into());
}
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs b/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs
index a4df61ae8b..077bf0dcd2 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs
@@ -467,7 +467,6 @@ impl FailureClassifier for NativeFailures {
}
fn classify_failure(&self, error: &str) -> FailureClassification {
- eprintln!("DBGRAW {error}");
if error == crate::channels::failure_copy::LEGACY_HISTORY_UNAVAILABLE {
return FailureClassification {
class: "channel_history_unavailable".to_owned(),
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
index 84b00689a4..8699527122 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
@@ -394,7 +394,6 @@ pub(crate) async fn run_admitted_turn(
}
let native_delivery_succeeded = execution.delivery_succeeded.unwrap_or(false);
let llm_result = execution.result.map_err(anyhow::Error::msg);
- if let Err(e) = &llm_result { eprintln!("DBGLLM {e}"); }
if let Some(token) = typing_cancellation.as_ref() {
token.cancel();