The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(channels): gate legacy host adapters behind test config
Steven Enamakel21bee4e49399
diff --git a/crates/openhuman-core/src/channels/host/adapters.rs b/crates/openhuman-core/src/channels/host/adapters.rsindex edbfe8441c..e2d8b094a0 100644--- a/crates/openhuman-core/src/channels/host/adapters.rs+++ b/crates/openhuman-core/src/channels/host/adapters.rs@@ -392,6 +392,7 @@ async fn publish_event(Ok(())}+#[cfg(test)]#[cfg(test)]#[async_trait]impl EventSink for OpenHumanEventSink {diff --git a/crates/openhuman-core/src/channels/host/mod.rs b/crates/openhuman-core/src/channels/host/mod.rsindex dfb48ef82d..d5746235fe 100644--- a/crates/openhuman-core/src/channels/host/mod.rs+++ b/crates/openhuman-core/src/channels/host/mod.rs@@ -1,34 +1,28 @@-//! OpenHuman implementation of the `tinychannels::host` capability boundary.+//! OpenHuman host callbacks and event subscribers for the TinyChannels module.//!-//! [`build_channel_host`] assembles the concrete [`tinychannels::ChannelHost`]-//! from OpenHuman internals (voice, inference, approvals, conversation store,-//! shutdown registry, web event bus). [`build_provider_context`] wraps it into-//! the [`tinychannels::host::ProviderContext`] handed to channel providers.-//!-//! [`ChannelApprovalSurfaceSubscriber`] and [`ChannelTurnStateSubscriber`]-//! bridge OpenHuman events into the provider-independent approval surface and-//! remote-control turn state; `remote_control` backs `/status`, `/sessions`-//! and `/new`.-//!-//! Ported providers reach host capabilities through this context instead of-//! calling OpenHuman internals directly — the inversion that lets them live in-//! the standalone `tinychannels` crate. Lean providers ignore the host.+//! Production startup serves the typed callback surface from `runtime::startup`;+//! legacy provider-trait adapters remain compiled only for their unit tests.mod adapters;mod channel_events;pub(crate) mod remote_control;+pub(crate) use adapters::{ConfigAllowlistStore, OpenHumanEventSink, VoiceTranscriber};+#[cfg(test)]pub use adapters::{- ConfigAllowlistStore, ConversationHistoryStore, CoreApprovalGate, CoreShutdownRegistry,- OpenHumanEventSink, VoiceSynthesizer, VoiceTranscriber,+ ConversationHistoryStore, CoreApprovalGate, CoreShutdownRegistry, VoiceSynthesizer,};pub use channel_events::{ChannelApprovalSurfaceSubscriber, ChannelTurnStateSubscriber};+#[cfg(test)]use std::sync::Arc;+#[cfg(test)]use tinychannels::host::ChannelHostBuilder;+#[cfg(test)]use tinychannels::ChannelHost;+#[cfg(test)]use crate::config::Config;/// Assemble the full OpenHuman [`ChannelHost`] from a config snapshot.@@ -39,6 +33,7 @@ use crate::config::Config;/// (turn dispatch, run ledger, pairing) are simply left unset — a provider/// that needs one degrades gracefully. Emoji reactions are deliberately unset:/// the local-model reaction gate was removed, so providers never react.+#[cfg(test)]pub fn build_channel_host(config: Arc<Config>) -> Arc<dyn ChannelHost> {ChannelHostBuilder::new().lifecycle(Arc::new(CoreShutdownRegistry))diff --git a/crates/openhuman-core/src/channels/host/remote_control.rs b/crates/openhuman-core/src/channels/host/remote_control.rsindex abd00fcc67..c19121fbda 100644--- a/crates/openhuman-core/src/channels/host/remote_control.rs+++ b/crates/openhuman-core/src/channels/host/remote_control.rs@@ -1,10 +1,4 @@-//! OpenHuman's [`RemoteControlHost`]: the host state behind `/status`,-//! `/sessions` and `/new` on every chat channel.-//!-//! Command parsing, rendering and the chat → thread bindings live in-//! `tinychannels::remote`. This adapter answers from the channel runtime-//! context (model routes, in-memory history), the conversation store and the-//! web-chat session cache.+//! Captured host conversation and session state supplied to the channel module.use crate::channels::context::{clear_sender_history, ChannelRuntimeContext};use crate::threads::store::{self as conversations, CreateConversationThread};diff --git a/crates/openhuman-core/src/channels/module_fixture_tests.rs b/crates/openhuman-core/src/channels/module_fixture_tests.rsindex 01df3263ac..abb551f4bc 100644--- a/crates/openhuman-core/src/channels/module_fixture_tests.rs+++ b/crates/openhuman-core/src/channels/module_fixture_tests.rs@@ -32,6 +32,7 @@ pub(crate) async fn client() -> ModuleClient {.name("tinychannels-test-module".into()).spawn(move || {let runtime = tokio::runtime::Builder::new_multi_thread()+ .worker_threads(2).enable_all().thread_name("tinychannels-test-bus").build()