Skip to content

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

fix(config): migrate composio mode disabled to connectors off

Steven Enamakelec479177bb24
diff --git a/crates/openhuman-core/src/config/schema/load/migrate.rs b/crates/openhuman-core/src/config/schema/load/migrate.rs
index df89487550..10083ef1fa 100644
--- a/crates/openhuman-core/src/config/schema/load/migrate.rs
+++ b/crates/openhuman-core/src/config/schema/load/migrate.rs
@@ -277,8 +277,9 @@ pub(crate) fn migrate_legacy_memory_backend(config: &mut Config, raw: &str) {
/// One-shot migration of the legacy per-dependency switches into
/// `[components]` (`hosting.enabled`, `search.enabled`, `mcp_client.enabled`,
-/// `memory.engine = "none"`, `OPENHUMAN_TINYMEMES`). `composio.enabled` was
-/// never read and is simply dropped with its field.
+/// `memory.engine = "none"`, `OPENHUMAN_TINYMEMES`, `composio.mode =
+/// "disabled"`). `composio.enabled` was never read and is simply dropped with
+/// its field; `composio.mode` stays as the route selector.
///
/// A legacy switch is read from the raw TOML (so an unset key keeps its
/// default) and only moves a component that `[components]` does not already
@@ -319,6 +320,13 @@ pub(crate) fn migrate_components_with(config: &mut Config, raw: &str, tinymemes:
disable(config, "hosting", legacy_bool("hosting"));
disable(config, "search", legacy_bool("search"));
disable(config, "mcp", legacy_bool("mcp_client"));
+ let composio_off = value
+ .as_ref()
+ .and_then(|v| v.get("composio"))
+ .and_then(|t| t.get("mode"))
+ .and_then(toml::Value::as_str)
+ .is_some_and(|m| m.trim().eq_ignore_ascii_case("disabled"));
+ disable(config, "connectors", composio_off.then_some(false));
let engine_none = value
.as_ref()
.and_then(|v| v.get("memory"))
diff --git a/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs b/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs
index 1457fffcc9..5d59f52e85 100644
--- a/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs
@@ -162,3 +162,28 @@ fn explicit_components_voice_wins_over_legacy_voice_switches() {
);
assert!(c.components.voice);
}
+
+#[test]
+fn composio_mode_disabled_migrates_to_components_connectors_off() {
+ let c = migrated("[composio]\nmode = \"disabled\"\n", None);
+ assert!(!c.components.connectors);
+ assert_eq!(
+ c.composio.mode, "disabled",
+ "mode stays as the route selector"
+ );
+ assert!(c.components.flows && c.components.search);
+}
+
+#[test]
+fn composio_backend_mode_or_explicit_components_key_keeps_connectors_on() {
+ assert!(
+ migrated("[composio]\nmode = \"direct\"\n", None)
+ .components
+ .connectors
+ );
+ let c = migrated(
+ "[composio]\nmode = \"disabled\"\n[components]\nconnectors = true\n",
+ None,
+ );
+ assert!(c.components.connectors, "explicit components key wins");
+}