Skip to content

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

refactor(core): update turn host logic and expose attachment ops

Steven Enamakel0bab9583c67e
diff --git a/crates/openhuman-core/src/agent/turn_host.rs b/crates/openhuman-core/src/agent/turn_host.rs
index b77ca583c7..50483cd02d 100644
--- a/crates/openhuman-core/src/agent/turn_host.rs
+++ b/crates/openhuman-core/src/agent/turn_host.rs
@@ -123,20 +123,30 @@ impl AgentTurnHost {
// Keep the large agent future behind a pointer while the origin scope
// is active. The origin is explicit and independent from RPC metadata.
- let turn = match request.message_input {
- Some(input) => session.run_single_with_approval_and_message(
- &request.message,
- input,
- Some(request.origin.clone()),
- request.approval,
- ),
- None => session.run_single_with_approval(
- &request.message,
- Some(request.origin.clone()),
- request.approval,
- ),
+ let origin = request.origin;
+ let message = request.message;
+ let input = request.message_input;
+ let approval = request.approval;
+ let turn = async move {
+ match input {
+ Some(input) => {
+ session
+ .run_single_with_approval_and_message(
+ &message,
+ input,
+ Some(origin.clone()),
+ approval,
+ )
+ .await
+ }
+ None => {
+ session
+ .run_single_with_approval(&message, Some(origin.clone()), approval)
+ .await
+ }
+ }
};
- Box::pin(with_origin(request.origin, turn)).await
+ Box::pin(with_origin(origin, turn)).await
}
}
diff --git a/crates/openhuman-core/src/web_chat/ops.rs b/crates/openhuman-core/src/web_chat/ops.rs
index 2fc9887bcd..6f8bcbad7e 100644
--- a/crates/openhuman-core/src/web_chat/ops.rs
+++ b/crates/openhuman-core/src/web_chat/ops.rs
@@ -19,6 +19,7 @@ pub(super) use budget_correlation::{
pub use channel_ops::{
cancel_all_turns, cancel_chat_scoped, channel_web_cancel, channel_web_chat,
+ channel_web_chat_with_attachments, channel_web_chat_with_stored_attachments,
channel_web_queue_clear, channel_web_queue_remove, channel_web_queue_status,
};