Skip to content

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

refactor(channels): use contract metadata and remove the unused CLI provider export

Steven Enamakel8104edad2aeb
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.toml
index 068bcc2987..15da8320fd 100644
--- a/crates/openhuman-core/Cargo.toml
+++ b/crates/openhuman-core/Cargo.toml
@@ -256,20 +256,18 @@ tinymcp = { path = "../../vendor/tinymcp/crates/tinymcp", default-features = fal
] }
tinymcp-bus = { path = "../../vendor/tinymcp/crates/tinymcp-bus", features = ["schemars"] }
# The transport-free channel vocabulary: inbound envelopes, outbound intents,
-# the config schema, controller metadata, relay frames and the session-key
-# rules. UNCONDITIONAL, and deliberately so — `DomainEvent` embeds
+# the config schema, controller metadata and relay frames. UNCONDITIONAL — `DomainEvent` embeds
# `ChannelInboundEnvelope`, `config/schema/channels.rs` re-exports the config
-# types and `security/pairing.rs` re-exports the pairing helpers, so this
-# vocabulary is always-on kernel surface. It costs serde/schemars and nothing
+# types, so this vocabulary is always-on kernel surface. It costs serde/schemars and nothing
# this build did not already have.
tinychannels-bus = { version = "0.1", path = "../../vendor/tinychannels/crates/tinychannels-bus" }
-# `CliChannel` (always compiled) and the channel runtime helpers.
+# Remaining channel runtime helpers and provider traits (temporary migration dependency).
tinychannels-runtime = { version = "0.1", path = "../../vendor/tinychannels/crates/tinychannels-runtime" }
# The provider stack that IMPLEMENTS that vocabulary — Telegram, Discord,
# Slack, IMAP, WhatsApp, the relay transport loop. Optional: it owns the
# `reqwest` / `rusqlite` / `rustls` / `tokio-tungstenite` cohort, which a
-# workflow-only build has no use for. Enabled by `channels`, and by `voice`
-# for `EmailChannel` alone.
+# workflow-only build has no use for. Enabled by `channels`; voice-only podcast
+# email executes through the separately loaded TinyChannels module.
tinychannels = { version = "0.1", features = ["relay-websocket"], optional = true }
# tinybus — the message bus. Owns what `crates/openhuman-core/src/core/event_bus/` used to: the typed
# pub/sub surface (`EventBus`, `EventHandler`, `SubscriptionHandle`), the
diff --git a/crates/openhuman-core/src/channels/README.md b/crates/openhuman-core/src/channels/README.md
index 3d6f0bbe09..f3d8ee7733 100644
--- a/crates/openhuman-core/src/channels/README.md
+++ b/crates/openhuman-core/src/channels/README.md
@@ -156,7 +156,7 @@ The in-app web chat (RPC namespace `channel`, singular) is a separate domain in
## Gotchas
-- The `channels` feature (default on; `channels = ["dep:tinychannels", "tinychannels/email", "tinychannels/lark"]` in [`crates/openhuman-core/Cargo.toml`](../../Cargo.toml)) gates almost everything. Three pieces stay ungated because always-on code names them: `traits` (the agent session host's interactive loop and `cron::bus`), `CliChannel` (re-exported from the unconditional `tinychannels-runtime` crate), and `contract_schema` (used by `openhuman-tinyhumans`). The config schema, the `DomainEvent` inbound envelope and security pairing resolve through `tinychannels-bus`, which is unconditional. The gate sheds no transitive packages; its value is compile surface and binary size. The `voice` feature also enables `dep:tinychannels` (for `EmailChannel` only), so a build without `channels` still links the crate unless `voice` is off too. `WhatsAppWebChannel` additionally needs the `whatsapp-web` feature.
+- The default `channels` feature gates provider orchestration and enables the module loader. Serialized config, messages, and controller declarations use the unconditional `tinychannels-bus` contract. Legacy provider traits and runtime helpers remain linked as explicit migration exceptions. The CLI REPL is host-owned orchestration; voice-only podcast email uses the loaded module and does not enable the provider implementation. `WhatsAppWebChannel` additionally needs the `whatsapp-web` feature.
- `start_channels` is skipped on cores with no listening integrations, which includes most desktop installs. Anything every core needs (the `ChannelInboundSubscriber`, the web-only proactive subscriber, tool-timeout seeding, self-improvement subscribers, the flows trigger subscriber) is registered in `core/runtime/subscribers.rs`, not in `start_channels`. Put new always-needed wiring there.
- Several registrations in `start_channels` overlap with `bootstrap_core_runtime` (agent handlers, the agent definition registry). They are written to be idempotent; keep them that way.
- The channel session token must be captured before the first `await` on config loading. Otherwise a logout during startup leaves a listener running for the old account.
diff --git a/crates/openhuman-core/src/channels/controllers/README.md b/crates/openhuman-core/src/channels/controllers/README.md
index bde5231b4b..aaddcad538 100644
--- a/crates/openhuman-core/src/channels/controllers/README.md
+++ b/crates/openhuman-core/src/channels/controllers/README.md
@@ -22,9 +22,9 @@ Owns the `channels.*` RPC namespace: provider metadata, connect/disconnect lifec
| `connect.rs` (+ `connect/`: `connect_channel.rs`, `disconnect.rs`, `email.rs`, `memory.rs`, `shared.rs`, `status.rs`, `test_channel.rs`) | `connect_channel`, `disconnect_channel`, `channel_status`, `test_channel`, `get_default_channel`/`set_default_channel`, clearing a disconnected channel's stored conversations through `memory::conversations::forget_channel` (`memory.rs`), email config persistence (`email.rs`; building and verifying email and Yuanbao configs is `tinychannels::controllers::build_email_config`, `tinychannels::providers::verify_email_credentials` and `tinychannels::providers::yuanbao::connect`), `connected_channel_slugs`, `merge_listener_health` (`pub(crate)`, re-exported from [`ops/mod.rs`](./ops/mod.rs) under `#[cfg(test)]`) |
| `discord.rs` | Discord OAuth link flow and guild/channel/permission listing |
| `messaging.rs` | `channel_send_message`, `channel_send_reaction`, `channel_create_thread`, `channel_update_thread`, `channel_list_threads`: all call the TinyHumans backend REST API (`crate::backend::BackendClient`); the only path that reaches the relay transport registry (`tinychannels::relay::runtime`) is `OpenHumanChannelBackend::send_outbound_intent` in `backend.rs` |
-| `types.rs` | Re-exports of `tinychannels::controllers` result/snapshot types used by the ops layer |
+| `types.rs` | Re-exports of `tinychannels_bus::controllers` result/snapshot types used by the ops layer |
-`connected_channel_slugs` (from `connect.rs`) is re-exported at `channels::controllers::connected_channel_slugs` for callers outside the controller registry; the `ops/mod.rs` comment cites the welcome agent's onboarding snapshot, but nothing outside [`channels/controllers/`](./) calls it today. `types.rs` re-exports the `tinychannels::controllers` result types (`ChannelStatusEntry`, `ChannelSendMessageResult`, and others) rather than defining its own.
+`connected_channel_slugs` (from `connect.rs`) is re-exported at `channels::controllers::connected_channel_slugs` for callers outside the controller registry; the `ops/mod.rs` comment cites the welcome agent's onboarding snapshot, but nothing outside [`channels/controllers/`](./) calls it today. `types.rs` re-exports the `tinychannels_bus::controllers` result types (`ChannelStatusEntry`, `ChannelSendMessageResult`, and others) rather than defining its own.
## Wiring
@@ -41,3 +41,5 @@ Owns the `channels.*` RPC namespace: provider metadata, connect/disconnect lifec
- [Parent module README](../README.md)
- [Messaging channels](../../../../../gitbooks/features/channels.md)
- [tinychannels](../../../../../vendor/tinychannels/README.md)
+
+Credential testing (`test_channel`) delegates structural validation and IMAP verification through the released module’s confidential controller member. Config persistence and credential custody remain in OpenHuman.
diff --git a/crates/openhuman-core/src/channels/controllers/backend.rs b/crates/openhuman-core/src/channels/controllers/backend.rs
index e5b2f52785..c7dc585288 100644
--- a/crates/openhuman-core/src/channels/controllers/backend.rs
+++ b/crates/openhuman-core/src/channels/controllers/backend.rs
@@ -8,14 +8,14 @@ use crate::config::{ChannelsConfig, Config};
use crate::core::Outcome;
use super::ops;
-use tinychannels::controllers::{
+use tinychannels::{ChannelBackend, ChannelOutboundIntent, SendMessage};
+use tinychannels_bus::controllers::{
ChannelAuthMode, ChannelConnectionResult, ChannelDisconnectResult, ChannelReactionResult,
ChannelSendMessageResult, ChannelStatusEntry, ChannelTestResult, ChannelThreadListResult,
ChannelThreadResult, DiscordChannelEntry, DiscordChannelListResult, DiscordGuildEntry,
DiscordGuildListResult, DiscordLinkCheckResult, DiscordLinkStartResult,
DiscordPermissionCheckResult, TelegramLoginCheckResult, TelegramLoginStartResult,
};
-use tinychannels::{ChannelBackend, ChannelOutboundIntent, SendMessage};
/// OpenHuman-owned implementation of the TinyChannels backend contract.
#[derive(Debug, Clone)]
diff --git a/crates/openhuman-core/src/channels/controllers/backend_tests.rs b/crates/openhuman-core/src/channels/controllers/backend_tests.rs
index f8e5624ef9..72e351de5f 100644
--- a/crates/openhuman-core/src/channels/controllers/backend_tests.rs
+++ b/crates/openhuman-core/src/channels/controllers/backend_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use tinychannels::controllers::ChannelThreadListResult;
+use tinychannels_bus::controllers::ChannelThreadListResult;
#[test]
fn send_message_payload_preserves_thread_and_subject() {
diff --git a/crates/openhuman-core/src/channels/controllers/schemas.rs b/crates/openhuman-core/src/channels/controllers/schemas.rs
index e577b9e81d..b96252dcb7 100644
--- a/crates/openhuman-core/src/channels/controllers/schemas.rs
+++ b/crates/openhuman-core/src/channels/controllers/schemas.rs
@@ -14,8 +14,8 @@ use super::backend::OpenHumanChannelBackend;
use super::definitions::ChannelAuthMode;
use crate::channels::contract_schema::from_channel_controller_schema;
use crate::security::credentials::channel_credential_provider;
-use tinychannels::controllers::{all_channel_controller_schemas, channel_controller_schema};
use tinychannels::{ChannelManager, ChannelsConfig};
+use tinychannels_bus::controllers::{all_channel_controller_schemas, channel_controller_schema};
// ---------------------------------------------------------------------------
// Param structs
diff --git a/crates/openhuman-core/src/channels/mod.rs b/crates/openhuman-core/src/channels/mod.rs
index 3fff207ee5..9d953949eb 100644
--- a/crates/openhuman-core/src/channels/mod.rs
+++ b/crates/openhuman-core/src/channels/mod.rs
@@ -4,8 +4,8 @@
//! messages, and schemas come from `tinychannels-bus`. Podcast email delivery
//! calls the loaded module even in a voice-only build.
//!
-//! The local REPL and legacy channel trait remain explicit implementation
-//! exceptions while the remaining channel runtime is migrated to TinyBus.
+//! The local REPL is host orchestration. The legacy provider trait remains an
+//! explicit implementation exception during the runtime migration to TinyBus.
// Always-compiled carve-outs (see module docs).
pub mod contract_schema;
@@ -13,7 +13,6 @@ pub mod contract_schema;
pub(crate) mod credentials;
pub mod traits;
-pub use tinychannels_runtime::CliChannel;
pub use traits::{Channel, ChannelSendExt, SendMessage};
#[cfg(feature = "channels")]
diff --git a/crates/openhuman-core/src/channels/providers/README.md b/crates/openhuman-core/src/channels/providers/README.md
index 99fb27896c..243b8f065a 100644
--- a/crates/openhuman-core/src/channels/providers/README.md
+++ b/crates/openhuman-core/src/channels/providers/README.md
@@ -22,7 +22,7 @@ Implementations live in [`vendor/tinychannels/src/providers/`](../../../../../ve
| `whatsapp_web` | `WhatsAppWebChannel` | `whatsapp-web` (forwards to `tinychannels/whatsapp-web`) |
| `yuanbao` | `YuanbaoChannel` | `channels` |
-`CliChannel` is not a provider re-export: `channels/mod.rs` takes it from the ungated `tinychannels-runtime` crate.
+The local CLI REPL is OpenHuman orchestration and does not import a TinyChannels CLI provider.
## Relay