Skip to content

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

refactor(attachments): enhance attachment access scope initialization

Steven Enamakel8169a0b65d39
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs b/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs
index 9c66fc8a35..a3199c11d8 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs
@@ -492,6 +492,7 @@ pub async fn agent_chat_reply_for(
let scope = crate::agent::attachments::AttachmentAccessScope {
external_channel: false,
workspace: turn_cwd.clone(),
+ ..Default::default()
};
let references = crate::agent::attachments::host::stage_host(
attachments,
diff --git a/crates/openhuman-core/src/threads/attachments.rs b/crates/openhuman-core/src/threads/attachments.rs
index 8d77e61d18..3a71649ae7 100644
--- a/crates/openhuman-core/src/threads/attachments.rs
+++ b/crates/openhuman-core/src/threads/attachments.rs
@@ -284,6 +284,7 @@ pub(crate) async fn restage_persisted_parts(
let scope = crate::agent::attachments::AttachmentAccessScope {
external_channel: false,
workspace: Some(workspace),
+ ..Default::default()
};
for part in &mut resolved {
let media = opaque_media_mut(part)
diff --git a/crates/openhuman-core/src/threads/attachments/staged.rs b/crates/openhuman-core/src/threads/attachments/staged.rs
index a9ed80e9e0..5f32b9e498 100644
--- a/crates/openhuman-core/src/threads/attachments/staged.rs
+++ b/crates/openhuman-core/src/threads/attachments/staged.rs
@@ -446,6 +446,8 @@ pub(super) async fn validate_staged_files(
let scope = crate::agent::attachments::AttachmentAccessScope {
external_channel: false,
workspace: Some(workspace.clone()),
+ thread_id: Some(thread_id.to_owned()),
+ ..Default::default()
};
let path = crate::agent::attachments::resolve_path(config, &entry.path, &scope)
.await
@@ -520,6 +522,8 @@ pub(super) async fn discard_staged_entries(
let scope = crate::agent::attachments::AttachmentAccessScope {
external_channel: false,
workspace: Some(workspace.clone()),
+ thread_id: Some(thread_id.to_owned()),
+ ..Default::default()
};
let path = crate::agent::attachments::resolve_path(config, &entry.path, &scope)
.await
diff --git a/crates/openhuman-core/src/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rs
index 4598647f40..bb6b928329 100644
--- a/crates/openhuman-core/src/threads/ops/crud.rs
+++ b/crates/openhuman-core/src/threads/ops/crud.rs
@@ -317,6 +317,7 @@ pub(super) async fn message_append_with_config(
Some(crate::agent::turn_origin::AgentTurnOrigin::ExternalChannel { .. })
),
workspace: Some(workspace.clone()),
+ ..Default::default()
};
let path = crate::agent::attachments::resolve_path(config, &file.path, &scope)
.await
diff --git a/crates/openhuman-core/src/web_chat/ingress.rs b/crates/openhuman-core/src/web_chat/ingress.rs
index 00d46c594b..d0e71f7997 100644
--- a/crates/openhuman-core/src/web_chat/ingress.rs
+++ b/crates/openhuman-core/src/web_chat/ingress.rs
@@ -86,6 +86,7 @@ impl WebIngress {
&crate::agent::attachments::AttachmentAccessScope {
external_channel: false,
workspace: Some(workspace),
+ ..Default::default()
},
)
.await