Skip to content

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

fix(runtime): pass dispatch context into domain subscriber registration

Steven Enamakel957ee2c58da1
diff --git a/crates/openhuman-core/src/core/runtime/bootstrap.rs b/crates/openhuman-core/src/core/runtime/bootstrap.rs
index fbd61b66fb..280583d039 100644
--- a/crates/openhuman-core/src/core/runtime/bootstrap.rs
+++ b/crates/openhuman-core/src/core/runtime/bootstrap.rs
@@ -75,6 +75,7 @@ pub(crate) async fn bootstrap_core_runtime(
cfg.clone(),
embedded_core,
domains,
+ ctx,
);
// Latch the config-corruption recovery signal (#5167) so `app_state_snapshot`
diff --git a/crates/openhuman-core/src/core/runtime/subscribers.rs b/crates/openhuman-core/src/core/runtime/subscribers.rs
index b7326efc27..5265572a3b 100644
--- a/crates/openhuman-core/src/core/runtime/subscribers.rs
+++ b/crates/openhuman-core/src/core/runtime/subscribers.rs
@@ -110,6 +110,7 @@ pub(super) fn register_domain_subscribers(
config: crate::config::Config,
embedded_core: bool,
domains: crate::core::runtime::DomainSet,
+ ctx: &DispatchCtx,
) {
use crate::core::all::DomainGroup;
use std::sync::{Arc, Once};
@@ -174,8 +175,9 @@ pub(super) fn register_domain_subscribers(
crate::security::credentials::seed_api_key_from_env(&config);
if std::env::var_os(crate::security::credentials::BACKEND_SESSION_TOKEN_ENV).is_some() {
let config = config.clone();
+ let ctx = ctx.clone();
tokio::spawn(async move {
- crate::security::credentials::seed_session_from_env(&DispatchCtx::ambient(), &config).await;
+ crate::security::credentials::seed_session_from_env(&ctx, &config).await;
});
}
diff --git a/crates/openhuman-core/src/core/runtime/subscribers_tests.rs b/crates/openhuman-core/src/core/runtime/subscribers_tests.rs
index 7432a1c953..865420c2e9 100644
--- a/crates/openhuman-core/src/core/runtime/subscribers_tests.rs
+++ b/crates/openhuman-core/src/core/runtime/subscribers_tests.rs
@@ -202,6 +202,7 @@ async fn tool_timeout_seeds_on_channelless_core_boot() {
config,
true,
crate::core::runtime::DomainSet::none(),
+ &crate::core::runtime::DispatchCtx::ambient(),
);
assert_eq!(
diff --git a/crates/openhuman-core/src/memory/backfill.rs b/crates/openhuman-core/src/memory/backfill.rs
index ec46e3e19f..22b2a6fc80 100644
--- a/crates/openhuman-core/src/memory/backfill.rs
+++ b/crates/openhuman-core/src/memory/backfill.rs
@@ -222,7 +222,7 @@ pub async fn start(
.unwrap_or_else(std::sync::PoisonError::into_inner)
.insert(workspace_dir.clone());
if !claimed {
- return status(config).await;
+ return status(ctx, config).await;
}
let mut file = read_file(&workspace_dir);
let plans = match plan(ctx, &workspace_dir, Some(&bound), &file.stored).await {