Skip to content

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

refactor(agent): use default for attachment scope initialization

Steven Enamakel3a7c35768a01
diff --git a/crates/openhuman-core/src/agent/attachments/mod.rs b/crates/openhuman-core/src/agent/attachments/mod.rs
index 12bad1a428..4476ec9500 100644
--- a/crates/openhuman-core/src/agent/attachments/mod.rs
+++ b/crates/openhuman-core/src/agent/attachments/mod.rs
@@ -367,6 +367,7 @@ pub(crate) async fn store_scoped_channel_media(
let scope = AttachmentAccessScope {
external_channel: false,
workspace: Some(config.action_dir.clone()),
+ ..Default::default()
};
save(config, thread, name, mime, bytes, &scope).await
}
@@ -505,6 +506,7 @@ pub(crate) async fn delegation_prompt(
let scope = AttachmentAccessScope {
external_channel: false,
workspace: workspace.map(|workspace| workspace.root.clone()),
+ ..Default::default()
};
stage(&prompt, "delegation", &config, &scope).await
}
@@ -543,6 +545,7 @@ pub(crate) async fn has_resolvable_image(
let scope = AttachmentAccessScope {
external_channel: false,
workspace: workspace.map(|workspace| workspace.root.clone()),
+ ..Default::default()
};
for path in paths {
let path = legacy::migrate_path(&config, &path, &scope)
@@ -640,6 +643,7 @@ pub(crate) async fn stage_turn(
Some(crate::agent::turn_origin::AgentTurnOrigin::ExternalChannel { .. })
),
workspace: workspace.map(|workspace| workspace.root.clone()),
+ ..Default::default()
};
stage(message, thread.unwrap_or("direct"), &config, &scope).await
}
diff --git a/crates/openhuman-core/src/agent/harness/graph.rs b/crates/openhuman-core/src/agent/harness/graph.rs
index 245904bd25..2eace68af8 100644
--- a/crates/openhuman-core/src/agent/harness/graph.rs
+++ b/crates/openhuman-core/src/agent/harness/graph.rs
@@ -122,6 +122,7 @@ pub(crate) async fn run_channel_turn_via_graph(
Some(crate::agent::turn_origin::AgentTurnOrigin::ExternalChannel { .. })
),
workspace: workspace.clone(),
+ ..Default::default()
};
row.content =
crate::agent::attachments::stage(&row.content, "channel", config, &scope).await?;