Skip to content

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

fix: restore medulla runtime domain wiring

Steven Enamakel66d7084c0541
diff --git a/crates/openhuman-core/src/core/runtime/builder.rs b/crates/openhuman-core/src/core/runtime/builder.rs
index 226c5ddc63..d96d97bdfc 100644
--- a/crates/openhuman-core/src/core/runtime/builder.rs
+++ b/crates/openhuman-core/src/core/runtime/builder.rs
@@ -198,6 +198,9 @@ pub struct DomainSet {
/// future backing controller would stay live. Fold the media-generation
/// controller into this group when it lands.
pub media: bool,
+ /// Medulla integration: cloud client, session runtime, chat store, and
+ /// authored harness workflows.
+ pub medulla: bool,
/// Model inference: providers, routing, local engines, embeddings.
pub inference: bool,
/// External connectors (Composio, calendar, file storage, task sources).
@@ -233,6 +236,7 @@ impl DomainSet {
web3: true,
voice: true,
media: true,
+ medulla: true,
inference: true,
integrations: true,
automation: true,
@@ -261,6 +265,7 @@ impl DomainSet {
web3: false,
voice: false,
media: false,
+ medulla: false,
inference: false,
integrations: false,
automation: false,
@@ -306,6 +311,7 @@ impl DomainSet {
web3: false,
voice: false,
media: false,
+ medulla: true,
inference: true,
integrations: true,
automation: true,
@@ -340,6 +346,7 @@ impl DomainSet {
web3: false,
voice: false,
media: false,
+ medulla: false,
inference: false,
integrations: false,
automation: false,
@@ -366,6 +373,7 @@ impl DomainSet {
web3: false,
voice: false,
media: false,
+ medulla: false,
inference: false,
integrations: false,
automation: false,
@@ -392,6 +400,7 @@ impl DomainSet {
DomainGroup::Web3 => self.web3,
DomainGroup::Voice => self.voice,
DomainGroup::Media => self.media,
+ DomainGroup::Medulla => self.medulla,
DomainGroup::Inference => self.inference,
DomainGroup::Integrations => self.integrations,
DomainGroup::Automation => self.automation,
diff --git a/crates/openhuman-core/src/core/runtime/builder_tests.rs b/crates/openhuman-core/src/core/runtime/builder_tests.rs
index d66d28a714..8af49c17b9 100644
--- a/crates/openhuman-core/src/core/runtime/builder_tests.rs
+++ b/crates/openhuman-core/src/core/runtime/builder_tests.rs
@@ -18,6 +18,7 @@ fn domain_set_presets_have_expected_flags() {
DomainGroup::Web3,
DomainGroup::Voice,
DomainGroup::Media,
+ DomainGroup::Medulla,
DomainGroup::Integrations,
DomainGroup::Platform,
] {
@@ -44,6 +45,7 @@ fn domain_set_presets_have_expected_flags() {
DomainGroup::Web3,
DomainGroup::Voice,
DomainGroup::Media,
+ DomainGroup::Medulla,
DomainGroup::Platform,
] {
assert!(!harness.allows(off), "harness() must NOT allow {off:?}");
@@ -64,6 +66,7 @@ fn domain_set_presets_have_expected_flags() {
DomainGroup::Web3,
DomainGroup::Voice,
DomainGroup::Media,
+ DomainGroup::Medulla,
DomainGroup::Platform,
] {
assert!(!none.allows(group), "none() must NOT allow {group:?}");
@@ -84,6 +87,7 @@ fn embedded_domain_set_enables_the_host_families() {
DomainGroup::Threads,
DomainGroup::Config,
DomainGroup::Security,
+ DomainGroup::Medulla,
DomainGroup::Platform,
] {
assert!(set.allows(on), "embedded() must allow {on:?}");
@@ -101,6 +105,7 @@ fn embedded_domain_set_enables_the_host_families() {
#[test]
fn embedded_keeps_flows_on_for_workflow_boot_reconcile() {
+ // Not incidental: `medulla_workflows` runs on the tinyflows engine and
// boot reconciliation keys off `ctx.domains().flows`, not a ServiceSet
// flag. Turning this off silently strands orphaned runs.
assert!(DomainSet::embedded().allows(DomainGroup::Flows));
@@ -115,7 +120,7 @@ fn embedded_keeps_channels_on_for_web_chat() {
}
#[test]
-fn embedded_is_not_harness() {
+fn embedded_is_not_harness_plus_medulla() {
// Guards the most tempting future "simplification": deriving this
// preset from harness(), which leaves the supporting Platform,
// Channels, and Integrations families off.
diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rs
index b5593d9f4c..f4d7bb72b4 100644
--- a/crates/openhuman-core/src/core/runtime/services.rs
+++ b/crates/openhuman-core/src/core/runtime/services.rs
@@ -534,6 +534,10 @@ pub fn spawn_socket_auto_connect(
// `Config` resolved above, which a workspace switch invalidates.
// `set_workflow_bridge` re-advertises over a live socket by
// design, so reinstall and skip only the handshake.
+ #[cfg(feature = "flows")]
+ if _flows_enabled {
+ crate::flows::medulla_bridge::install(std::sync::Arc::clone(&config));
+ }
log::info!(
"[socket] Auto-connect: {api_url} already connected with this session — refreshed the workflow bridge, kept the socket"
);
@@ -543,6 +547,10 @@ pub fn spawn_socket_auto_connect(
log::error!("[socket] Auto-connect could not stop the prior connection: {e}");
return;
}
+ #[cfg(feature = "flows")]
+ if _flows_enabled {
+ crate::flows::medulla_bridge::install(std::sync::Arc::clone(&config));
+ }
let provider =
crate::platform::socket::token_provider::token_provider_from_config(config);
if let Err(e) = socket_mgr.connect_with_provider(&api_url, provider).await {