Skip to content

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

chore(agents, cargo): document that the channels gate sheds no dependencies

Steven Enamakel575e4e9f2b16
diff --git a/AGENTS.md b/AGENTS.md
index 3ed97fb3cd..3517dfd5d9 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -791,7 +791,7 @@ Two columns because there are two sets (see above): **Contrib** is `[features] d
| `flows` | ON | ON | `openhuman::flows` (saved automation graphs — create/run/schedule, the `workflow_builder` + `flow_discovery` agents), `openhuman::flows::tinyflows` (engine seam), `openhuman::flows::rhai` (`.ragsh` language-workflow tool) | `tinyflows`, `jaq-core`, `jaq-std`, `jaq-json`, `rhai` |
| `mcp` | ON | ON | `openhuman::mcp::server` (the `openhuman mcp` stdio/HTTP server), `openhuman::mcp::registry` (dynamic Smithery installs — `mcp_clients` RPC namespace, SQLite, boot spawn, supervisor, OAuth), `openhuman::mcp::audit` (write-audit log), and the static config-declared server set in `openhuman::mcp::config_servers`. ~19 agent tools, ~20k LOC | **none** — and the `tinymcp` module extraction does not change that either; see the scope note |
| `tui` | OFF | — | `openhuman::tui` — the tabbed ratatui/crossterm CLI UI (Logs, Chat, Config, Settings), auto-opened by bare `openhuman` on interactive non-container hosts and forced with `openhuman tui` (alias `chat`). Runs the core in-process. No controllers, no agent tools. **Intentionally NOT forwarded to the desktop shell** (allowlisted in `check-feature-forwarding.mjs`). | `ratatui`, `crossterm` |
-| `channels` | ON | ON | `openhuman::channels` (external-messaging providers — Telegram/Discord/Slack/Signal/WhatsApp/iMessage/IRC/… — plus the channel runtime, controllers, host, proactive messaging + inbound dispatch) and the `webview_notifications` bridge domain. **Carve-outs `channels::{traits, cli}` stay ungated.** The family now owns **no agent tool** — the three `whatsapp_data_*` tools were its only ones and went with the store (see below) — which is why `DomainGroup::Channels` is in `TOOL_LESS` in `tools/ops_tests.rs`, alongside `Relay`. | the whole `tinychannels` crate — the provider stack and relay transport loop, with `reqwest` / `rusqlite` / `rustls` / `tokio-tungstenite` and the email + lark cohorts. The contract half stays as the unconditional `tinychannels-bus` |
+| `channels` | ON | ON | `openhuman::channels` (external-messaging providers — Telegram/Discord/Slack/Signal/WhatsApp/iMessage/IRC/… — plus the channel runtime, controllers, host, proactive messaging + inbound dispatch) and the `webview_notifications` bridge domain. **Carve-outs `channels::{traits, cli}` stay ungated.** The family now owns **no agent tool** — the three `whatsapp_data_*` tools were its only ones and went with the store (see below) — which is why `DomainGroup::Channels` is in `TOOL_LESS` in `tools/ops_tests.rs`, alongside `Relay`. | **none in the kernel profile** — measured 288/270/2 before and after; the gate swaps `tinychannels` for `tinychannels-bus` one-for-one, because every heavy dep it carried is shared. It buys ~31.7k lines of compile surface, not crates. The email + lark cohorts are shed only relative to a `channels`-ON build |
| `contacts` | OFF | ON | `memory::people::address_book`'s macOS CNContactStore reader — the address-book seeding path for the people domain. Leaf gate over a **pre-existing** off-state: the module already shipped a non-macOS `imp` stub returning an empty contact list, so the gate only widens that stub's cfg. `read`/`read_with`/`AddressBookError`/`SystemContactsSource` and the whole `people` RPC surface stay compiled in every build; off ⇒ a refresh seeds nothing instead of failing. | **6** on macOS (`objc2`, `objc2-foundation`, `objc2-contacts`, `block2` + 2 transitive). **No-op on Linux/Windows** — never in those graphs, so the kernel-floor ratchet does not move. Verify cross-target: `cargo tree --target aarch64-apple-darwin -e normal -i objc2-contacts --no-default-features` (294 → 288 packages). |
| `runtime-node` | OFF | ON | `runtime::node` (the client that asks the `tinyruntime` module for a Node.js toolchain), the `runtime::javascript` language slot, `runtime::pool::node`, the `node_exec` / `npm_exec` agent tools, and the `node_runtime` harness-init step. **Facade + stub** — `ShellTool` holds `Option<Arc<NodeBootstrap>>` and `shell.rs` is kernel, so the module cannot simply vanish; `runtime/node/stub.rs` carries the `NodeBootstrap` type surface while registration sites are leaf-gated. **The generic native-tool dispatcher (`runtime::node::ops` / `runtime::node::types`) is NOT gated** — it backs both the gated `javascript.*` controllers and the ungated `flows` `oh:` `NativeToolBackend`, so native flow tools (`memory_search`, file, shell, …) keep working when the managed Node runtime is off. Off ⇒ `try_cached`/`probe_installed` return `None` and the shell never prepends a managed bin dir, identical to today's `node.enabled = false` path. | **Nothing any more.** This gate used to shed `xz2` and its static liblzma C build; download and extraction moved into the `tinyruntime` module, so that native build left the manifest for **every** configuration rather than only for slim ones. The gate still buys the absence of the tools and controllers. |
@@ -1067,7 +1067,11 @@ Leaf-gate pattern with **two ungated carve-outs and no stub file** — the reach
- **The gate now owns the crate.** This bullet has been rewritten twice, and the history is the useful part. It first read "Sheds ZERO dependencies — do NOT re-litigate", on the premise that **`tinychannels` can never be gated out**: `config/schema/channels.rs` re-exports its config types, `DomainEvent` embeds `ChannelInboundEnvelope` in an always-on enum, and `security/pairing.rs` re-exports its pairing helpers. It then became "sheds 28 crates" once the two heavy *providers* (`email_channel`'s lettre/async-imap/mail-parser, `lark`'s axum + prost) were gated **inside** the vendored crate, while the premise was left standing.
- The premise is now false, and deliberately so. Splitting **`tinychannels-bus`** out of the crate (the same shape as `tinydocs-bus` / `tinywallet-bus`) moved all three always-on pins into a transport-free contract crate — envelopes, intents, `ChannelsConfig`, controller metadata, relay frames, the session-key rules and the pairing helpers — costing serde/schemars/thiserror and nothing this build did not already have. `tinychannels-bus` is unconditional; **`tinychannels` is `optional = true`**, and what stays behind the gate with it is the provider stack and the relay transport loop, plus `reqwest`, `rusqlite`, `rustls` and `tokio-tungstenite`.
+ The premise is now false, and deliberately so. Splitting **`tinychannels-bus`** out of the crate (the same shape as `tinydocs-bus` / `tinywallet-bus`) moved all three always-on pins into a transport-free contract crate — envelopes, intents, `ChannelsConfig`, controller metadata, relay frames, the session-key rules and the pairing helpers. `tinychannels-bus` is unconditional; **`tinychannels` is `optional = true`**, and the provider stack and relay transport loop go behind the gate with it.
+
+ **Measured, this sheds ZERO dependencies, and you should expect that.** The kernel profile is **288 packages / 270 names / 2 native before and after** — a diff of the two package lists is literally one line, `tinychannels` out, `tinychannels-bus` in. Every heavy crate tinychannels carried is shared with kernel surface (`rusqlite` has six parents, `reqwest` ten), so removing its *parent* frees nothing. This is the third time this exact result has been recorded here — the TinyMemory port and the `tinymcp` extraction both landed at −1/−1/0 for the same reason — so **do not open this seam expecting a dependency win.**
+
+ What it does buy is a **compilation** boundary and an architectural one: a `channels`-less build compiles **~31.7k lines instead of ~39.3k**, since only the ~7.6k-line contract crate remains. And the contract is now a real `-bus` crate, which is the prerequisite for moving the providers out of the binary entirely.
**Never re-declare a contract type host-side.** `channels/traits.rs` — the ungated carve-out — points at `tinychannels_bus`, not `tinychannels`, precisely because the implementation crate is optional and the vocabulary is not. Same rule as every other `-bus` crate: a field added on one side of a copy is a decode failure on the other, with nothing to catch it.
diff --git a/Cargo.toml b/Cargo.toml
index f63825727a..f4c2b9ec79 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1148,8 +1148,14 @@ medulla = []
# embedding `ChannelInboundEnvelope`, `security/pairing.rs` re-exporting the
# pairing helpers) now resolve through `tinychannels-bus`, the transport-free
# contract crate, which stays unconditional. What is left behind this gate is
-# the provider stack and the relay transport loop — and with them `reqwest`,
-# `rusqlite`, `rustls`, `tokio-tungstenite` and the email/lark cohorts.
+# the provider stack and the relay transport loop.
+#
+# It sheds NO dependencies and is not meant to: measured, the kernel profile is
+# 288 packages / 270 names / 2 native both before and after, and the package-list
+# diff is one line (`tinychannels` out, `tinychannels-bus` in). Every heavy crate
+# tinychannels carried is shared with kernel surface. What the gate buys is
+# compile surface — ~31.7k lines a channels-less build no longer compiles — plus
+# the contract crate the eventual module extraction needs.
#
# ONE caveat, and it is the reason a channels-less product build still links
# the crate: `voice` enables `dep:tinychannels` for `EmailChannel` alone
@@ -1165,8 +1171,9 @@ medulla = []
# `cli::CliChannel` is the dep-free local REPL used by the always-on agent
# harness interactive loop. See AGENTS.md "channels gate" + `channels/mod.rs`.
# The crate itself is now droppable, which it was not before: splitting
-# `tinychannels-bus` out moved every always-on pin into a contract crate that
-# costs serde/schemars and nothing this build did not already have.
+# `tinychannels-bus` out moved every always-on pin into a contract crate. That
+# is a compile-surface and architecture win, NOT a dependency win — see the
+# measured note above before claiming otherwise.
channels = ["dep:tinychannels", "tinychannels/email", "tinychannels/lark"]
sandbox-landlock = ["dep:landlock"]
sandbox-bubblewrap = []