Skip to content

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

refactor(session_host): hoist ambient dispatch context into a binding

Steven Enamakel0ee584b328d1
diff --git a/crates/openhuman-core/src/agent/session_host/builder/factory.rs b/crates/openhuman-core/src/agent/session_host/builder/factory.rs
index a91addd134..a2a68a54c4 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/factory.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/factory.rs
@@ -80,8 +80,8 @@ impl OpenHumanSessionHost {
pub fn from_config_for_agent(config: &Config, agent_id: &str) -> Result<Self> {
// A hosted profile never receives the ordinary config-derived belt: its
// operator-selected factory carries registration and permission bounds.
- if crate::profiles::capabilities::ProfileCapabilities::in_ctx(&DispatchCtx::ambient()).is_some()
- {
+ let ambient = DispatchCtx::ambient();
+ if crate::profiles::capabilities::ProfileCapabilities::in_ctx(&ambient).is_some() {
return Self::from_config_for_agent_session(config, agent_id, None);
}
let target_def = resolve_target_definition(config, agent_id)?;