Skip to content

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

feat(config): fold legacy channel listener flag into components

Steven Enamakeld0048d76bb59
diff --git a/crates/openhuman-core/src/config/schema/load/env_overlay/components.rs b/crates/openhuman-core/src/config/schema/load/env_overlay/components.rs
index ab31f8f3cf..954013e802 100644
--- a/crates/openhuman-core/src/config/schema/load/env_overlay/components.rs
+++ b/crates/openhuman-core/src/config/schema/load/env_overlay/components.rs
@@ -15,6 +15,18 @@ pub(crate) fn parse_flag(raw: &str) -> Option<bool> {
impl Config {
pub(super) fn apply_components_env<E: EnvLookup + ?Sized>(&mut self, env: &E) {
+ // Legacy listener kill switch, folded into `components.channels` for
+ // one release. An explicit `OPENHUMAN_COMPONENT_CHANNELS` below wins.
+ if env
+ .get("OPENHUMAN_DISABLE_CHANNEL_LISTENERS")
+ .and_then(|raw| parse_flag(&raw))
+ == Some(true)
+ {
+ tracing::debug!(
+ "[components] OPENHUMAN_DISABLE_CHANNEL_LISTENERS folds to channels=false"
+ );
+ self.components.set("channels", false);
+ }
for name in COMPONENT_NAMES {
let key = format!("OPENHUMAN_COMPONENT_{}", name.to_ascii_uppercase());
let Some(raw) = env.get(&key) else { continue };
diff --git a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
index cd8fcc3cca..d3b863c6b6 100644
--- a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
@@ -569,3 +569,17 @@ fn env_overlay_component_switches_apply_and_ignore_garbage() {
cfg.apply_env_overlay_with(&env);
assert!(cfg.components.hosting, "env can switch a component back on");
}
+
+#[test]
+fn legacy_disable_channel_listeners_env_folds_into_channels_component() {
+ let mut cfg = Config::default();
+ cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_DISABLE_CHANNEL_LISTENERS", "1"));
+ assert!(!cfg.components.channels);
+
+ let mut cfg = Config::default();
+ let env = HashMapEnv::new()
+ .with("OPENHUMAN_DISABLE_CHANNEL_LISTENERS", "true")
+ .with("OPENHUMAN_COMPONENT_CHANNELS", "1");
+ cfg.apply_env_overlay_with(&env);
+ assert!(cfg.components.channels, "explicit component env wins");
+}
diff --git a/crates/openhuman-core/src/core/runtime/README.md b/crates/openhuman-core/src/core/runtime/README.md
index 53bbdba4d1..9a3a0cfbdd 100644
--- a/crates/openhuman-core/src/core/runtime/README.md
+++ b/crates/openhuman-core/src/core/runtime/README.md
@@ -43,7 +43,7 @@ Each flag is independent. Presets:
Individual services still honor their own runtime gates inside
`runtime/services.rs` regardless of `ServiceSet` selection: `cron` checks
`config.cron.enabled`; `channels` returns early on
-`OPENHUMAN_DISABLE_CHANNEL_LISTENERS=1` or when
+`OPENHUMAN_DISABLE_CHANNEL_LISTENERS=1` (also folded into `[components].channels`) or when
`config.channels_config.has_listening_integrations()` is false; `login_gated`
(`spawn_login_gated_services`) defers the login-gated services until a user
session exists on disk. `ServiceSet` picks *whether a service is spawned at
diff --git a/gitbooks/developing/components.md b/gitbooks/developing/components.md
index 7896d728d7..cf20cdc692 100644
--- a/gitbooks/developing/components.md
+++ b/gitbooks/developing/components.md
@@ -57,6 +57,7 @@ The first load of an older config moves these once into `[components]`, and the
| `[mcp_client] enabled = false` | `components.mcp = false` |
| `[memory] engine = "none"` | `components.memory = false` (`engine` is kept) |
| `OPENHUMAN_TINYMEMES` set to an off value | `components.memes = false` |
+| `OPENHUMAN_DISABLE_CHANNEL_LISTENERS=1` | `components.channels = false` at load (env override, kept for one release; `OPENHUMAN_COMPONENT_CHANNELS` wins) |
| `[composio] enabled` | dropped; it was never read |
A `components.*` key already present in the file always wins over its legacy flag, so the migration is idempotent and turning a component back on sticks.