Skip to content

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

fix(agent): deliver background results when the turn ends

Steven Enamakelbeb295605e19
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
index 41c7c9e26a..6cf71d2940 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
@@ -210,8 +210,10 @@ pub(super) fn drain_schedule_in(
&DispatchCtx::new(Arc::clone(ctx)),
session,
),
- // No owner: the unscoped (desktop) drain reads the ambient context.
- None => background_completions::thread_for_session(&DispatchCtx::ambient(), session),
+ // No owner: the unscoped (desktop) drain reads the host's own context.
+ None => {
+ background_completions::thread_for_session(&DispatchCtx::host_default(), session)
+ }
};
if thread_id.is_none() {
log::trace!("[background_delivery] session has no delivery thread; not scheduling");