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
docs(channels): update READMEs to reflect upstream capability flags and tinychannels-runtime
Steven Enamakel97b47ebf3aa0
diff --git a/crates/openhuman-core/src/channels/README.md b/crates/openhuman-core/src/channels/README.mdindex 06c37d78e2..60f30ce537 100644--- a/crates/openhuman-core/src/channels/README.md+++ b/crates/openhuman-core/src/channels/README.md@@ -4,7 +4,7 @@ Multi-platform messaging integration. Re-exports the `Channel` trait vocabulary,## Feature gate-The domain lives behind the `channels` feature (default-ON, #4801), except two dependency-free carve-outs that always-on code reaches directly: `traits` (the `Channel`/`SendMessage` re-export, named by the always-on agent-harness interactive loop in `agent/session_host/`) and `cli` (`CliChannel`, the stdin/stdout REPL that loop drives in every build). Everything else (`providers`, `host`, `controllers`, `runtime`, `bus`, `proactive`, `commands`, `context`, `routes`, `relay_runtime`, `system_prompt`, the provider re-exports, `doctor_channels`, `start_channels`, `build_system_prompt` and the `test_support` re-export) is `#[cfg(feature = "channels")]`. The feature owns the optional `tinychannels` crate (`channels = ["dep:tinychannels", "tinychannels/email", "tinychannels/lark"]`); the always-on pins (config schema, the `DomainEvent` inbound envelope, security pairing) resolve through the unconditional `tinychannels-bus` contract crate instead. Measured, the gate sheds no transitive packages: its value is compile surface and binary size. `voice` also re-enables `dep:tinychannels`, for `EmailChannel` alone. The full rationale is the comment above the `channels` feature in `crates/openhuman-core/Cargo.toml`.+The domain lives behind the `channels` feature (default-ON, #4801), except two dependency-free carve-outs that always-on code reaches directly: `traits` (the `Channel`/`SendMessage` re-export, named by the always-on agent-harness interactive loop in `agent/session_host/`) and `CliChannel` (the stdin/stdout REPL that loop drives in every build, re-exported from the unconditional `tinychannels-runtime` crate). Everything else (`providers`, `host`, `controllers`, `runtime`, `bus`, `proactive`, `commands`, `context`, `routes`, `system_prompt`, the provider re-exports, `doctor_channels`, `start_channels`, `build_system_prompt` and the `test_support` re-export) is `#[cfg(feature = "channels")]`. The feature owns the optional `tinychannels` crate (`channels = ["dep:tinychannels", "tinychannels/email", "tinychannels/lark"]`); the always-on pins (config schema, the `DomainEvent` inbound envelope, security pairing) resolve through the unconditional `tinychannels-bus` contract crate instead. Measured, the gate sheds no transitive packages: its value is compile surface and binary size. `voice` also re-enables `dep:tinychannels`, for `EmailChannel` alone. The full rationale is the comment above the `channels` feature in `crates/openhuman-core/Cargo.toml`.## Public surface@@ -14,7 +14,7 @@ The domain lives behind the `channels` feature (default-ON, #4801), except two d- `pub fn doctor_channels` (`commands.rs`): diagnoses connectivity for the doctor CLI.- `pub fn build_system_prompt`: re-exported from `crate::agent::context::channels_prompt`.- `pub(crate) enum ChannelSystemPrompt` (`system_prompt.rs`): the prompt a turn is seeded with, `fixed` (tests) or `refreshing` (production), which renders `build_system_prompt_with_identity` for the active agent definition.-- Per-provider channel structs re-exported from `providers/<name>.rs` (all thin `pub use tinychannels::providers::...` shims): `DingTalkChannel`, `DiscordChannel`, `EmailChannel`, `IMessageChannel`, `IrcChannel`, `LarkChannel`, `LinqChannel`, `MattermostChannel`, `QQChannel`, `SignalChannel`, `SlackChannel`, `TelegramChannel`, `WhatsAppChannel`, `YuanbaoChannel`. Cargo-feature-gated: `WhatsAppWebChannel` (`whatsapp-web`). `CliChannel` (`cli.rs`) is the one local implementation and is ungated.+- Per-provider channel structs re-exported from `providers/<name>.rs` (all thin `pub use tinychannels::providers::...` shims): `DingTalkChannel`, `DiscordChannel`, `EmailChannel`, `IMessageChannel`, `IrcChannel`, `LarkChannel`, `LinqChannel`, `MattermostChannel`, `QQChannel`, `SignalChannel`, `SlackChannel`, `TelegramChannel`, `WhatsAppChannel`, `YuanbaoChannel`. Cargo-feature-gated: `WhatsAppWebChannel` (`whatsapp-web`). `CliChannel` comes from `tinychannels-runtime` and is ungated.- Stable `pub use providers::<name>` paths for every provider, in `mod.rs`.- RPC `channels.{list, describe, connect, disconnect, status, set_default, get_default, test, telegram_login_start, telegram_login_check, discord_link_start, discord_link_check, discord_list_guilds, discord_list_channels, discord_check_permissions, send_message, send_reaction, create_thread, update_thread, list_threads}`, declared in `controllers/schemas.rs`.@@ -22,27 +22,27 @@ The domain lives behind the `channels` feature (default-ON, #4801), except two d| Path | Purpose || --- | --- |-| `providers/` | Per-provider re-exports from `tinychannels`, plus Telegram's host-coupled glue ([README](providers/README.md)) |-| `host/` | `build_channel_host` / `build_provider_context`, the OpenHuman implementation of `tinychannels::host` that ported providers call back into (adapters in `host/adapters.rs`: `VoiceTranscriber`, `VoiceSynthesizer`, `CoreApprovalGate`, `ConversationHistoryStore`, `InferenceReactionGate`, `OpenHumanEventSink`, `CoreShutdownRegistry`, `ConfigAllowlistStore`) |+| `providers/` | Per-provider re-exports from `tinychannels` ([README](providers/README.md)) |+| `host/` | `build_channel_host` / `build_provider_context`, the OpenHuman implementation of `tinychannels::host` that ported providers call back into (adapters in `host/adapters.rs`: `VoiceTranscriber`, `VoiceSynthesizer`, `CoreApprovalGate`, `ConversationHistoryStore`, `InferenceReactionGate`, `OpenHumanEventSink`, `CoreShutdownRegistry`, `ConfigAllowlistStore`); `host/remote_control.rs` (`RemoteControlHost` behind `/status`, `/sessions`, `/new`) and `host/channel_events.rs` (`ChannelApprovalSurfaceSubscriber`, `ChannelTurnStateSubscriber`), which give every capable provider in-chat approvals and remote control || `runtime/` | Startup, supervision, and the inbound dispatch loop into the agent ([README](runtime/README.md)) || `controllers/` | `channels.*` RPC namespace, `OpenHumanChannelBackend`, provider definitions ([README](controllers/README.md)) || `tests/` | Cross-channel integration test suite (`#[cfg(all(feature = "channels", test))]`) |-Flat files: `bus.rs` (`ChannelInboundSubscriber`, handles `DomainEvent::ChannelInboundMessage` published by the socket transport layer in `platform/socket/event_handlers.rs` and replies through the REST API; registered by `register_domain_subscribers` in `core/runtime/subscribers.rs`, not here), `cli.rs` (ungated `CliChannel`), `commands.rs` (`doctor_channels` and listener health classification), `context.rs` (`ChannelRuntimeContext`, per-sender conversation history, timeouts), `proactive.rs` (`ProactiveMessageSubscriber`, subscribes `DomainEvent::ProactiveMessageRequested` and delivers to the active channel), `relay_runtime.rs` (`relay_runtime_fronts_channel` / `send_outbound_intent`, the process-local relay-websocket transport handle controller sends go through when the relay fronts a channel), `routes.rs` (per-sender route overrides and runtime commands), `system_prompt.rs`, `traits.rs` (ungated `Channel`/`SendMessage` re-export).+Flat files: `bus.rs` (`ChannelInboundSubscriber`, handles `DomainEvent::ChannelInboundMessage` published by the socket transport layer in `platform/socket/event_handlers.rs`; the progressive reply is `tinychannels::delivery::progressive::ProgressiveReply` over `bus/delivery.rs`'s `BackendProgressiveSender`, the REST relay transport; registered by `register_domain_subscribers` in `core/runtime/subscribers.rs`, not here), `commands.rs` (`doctor_channels`, printing `tinychannels::runtime::check_channels_health`), `context.rs` (`ChannelRuntimeContext`, per-sender conversation history, timeouts), `proactive.rs` (`ProactiveMessageSubscriber`, subscribes `DomainEvent::ProactiveMessageRequested` and delivers to the active channel), `routes.rs` (per-sender route overrides and runtime commands, including `tinychannels::remote` commands on providers with the `remote_control` capability), `system_prompt.rs`, `traits.rs` (ungated `Channel`/`SendMessage` re-export).## Calls into- `crates/openhuman-core/src/agent/` — the agent turn is dispatched over `BUS.native()` to the `agent.run_turn` handler registered by `agent::bus::register_agent_handlers`, so `runtime/dispatch/` never imports the harness directly.- `crates/openhuman-core/src/agent/context/channels_prompt.rs` — channel system prompt rendering, re-exported as `build_system_prompt`.- `crates/openhuman-core/src/security/credentials/` — `AuthService` lookups for connect/disconnect and for secret hydration at startup (email password, Yuanbao app secret).-- `crates/openhuman-core/src/security/approval/` — `ApprovalGate` for the approval-reply intercept and `ApprovalChatContext` scoping of Telegram turns.+- `crates/openhuman-core/src/security/approval/` — `ApprovalGate` for the approval-reply intercept and `ApprovalChatContext` scoping of turns on every provider with the `chat_approvals` capability.- `crates/openhuman-core/src/config/` — `Config` / `ChannelsConfig` (schema types come from `tinychannels_bus::config` via `config/schema/channels.rs`).- `crates/openhuman-core/src/memory/conversations/` and `memory/guard` — conversation history persistence and the active memory guard.- `crates/openhuman-core/src/backend/client.rs` — `BackendClient` for controller messaging ops and Telegram/Discord link flows.- `crates/openhuman-core/src/web_chat/` — web-channel event publishing, session invalidation (`/new`), and the web surface subscribers registered at startup.- `crates/openhuman-core/src/voice/` — STT/TTS behind the `host/` adapters.- `crates/openhuman-core/src/core/bus.rs` and `core/events.rs` — the process-wide `BUS` and the `DomainEvent::Channel*` variants published from `runtime/dispatch/` and `runtime/supervision.rs`.-- `vendor/tinychannels/` — provider transports, `tinychannels::build_channels` (provider construction), `ChannelManager`/`ChannelBackend`, and the `tinychannels::host` capability boundary; `vendor/tinychannels/crates/tinychannels-bus` — the transport-free trait/type contract.+- `vendor/tinychannels/` — provider transports, `tinychannels::build_channels` (provider construction), `ChannelManager`/`ChannelBackend`, the `tinychannels::host` capability boundary, progressive delivery (`delivery::progressive`), remote control (`remote`), in-chat approvals (`approvals`), the relay transport registry (`relay::runtime`), connect-form parsing, and per-provider `ChannelCapabilities`; `vendor/tinychannels/crates/tinychannels-bus` — the transport-free trait/type contract.## Called by@@ -54,9 +54,8 @@ Flat files: `bus.rs` (`ChannelInboundSubscriber`, handles `DomainEvent::ChannelI## Tests-- Unit, flat files: `bus_tests.rs`, `bus_inbound_thread_id_tests_tests.rs`, `cli_tests.rs`, `commands_tests.rs`, `context_tests.rs`, `proactive_tests.rs`, `relay_runtime_tests.rs`, `routes_tests.rs`, `system_prompt_tests.rs`, `traits_tests.rs` (`bus/`'s `delivery.rs`, `draft.rs`, `filler.rs`, `progressive_ui.rs`, `streaming_state.rs`, `subscriber.rs`, `thinking.rs`, and `thread_id.rs` are source submodules, not tests; `bus_test_support_tests.rs` is a debug-build helper module).-- Cross-channel integration suite (`tests/`, see its module doc): `common.rs` fixtures plus `discord_integration`, `health`, `identity`, `memory`, `personality`, `prompt`, `runtime_dispatch`, `runtime_tool_calls`, `telegram_integration`.-- Host adapters: `host/host_tests.rs`.-- Provider host glue: `providers/telegram/{approval_surface_tests,bus_tests,remote_control_tests}.rs`.-- Controllers: `controllers/{backend_tests,ops_tests,schemas_tests}.rs` (+ `ops_connect_status_tests.rs`/`ops_yuanbao_email_tests.rs`), `controllers/ops/connect_email_config_tests_tests.rs`.+- Unit, flat files: `bus_tests.rs`, `bus_inbound_thread_id_tests_tests.rs`, `commands_tests.rs`, `context_tests.rs`, `proactive_tests.rs`, `routes_tests.rs`, `traits_tests.rs` (`bus/`'s `delivery.rs`, `subscriber.rs` and `thread_id.rs` are source submodules, not tests; `bus_test_support_tests.rs` is a debug-build helper module). Progressive delivery, remote control, approvals, relay registry, health checks, the CLI channel and connect-form parsing are tested upstream in `vendor/tinychannels`.+- Cross-channel integration suite (`tests/`, see its module doc): `common.rs` fixtures plus `discord_integration`, `health`, `identity`, `memory`, `prompt`, `runtime_dispatch`, `runtime_tool_calls`, `telegram_integration`.+- Host adapters: `host/host_tests.rs`, `host/channel_events_tests.rs`.+- Controllers: `controllers/{backend_tests,ops_tests,schemas_tests}.rs` (+ `ops_connect_status_tests.rs`/`ops_yuanbao_email_tests.rs`).- Runtime: `runtime/{startup_tests,startup_email_secret_tests_tests,startup_yuanbao_secret_tests_tests,supervision_tests,dispatch_tests}.rs`, `runtime/dispatch/{mod_scoping_tests_tests,mod_approval_surface_gating_tests_tests,routing_connected_fallback_tests_tests}.rs`.diff --git a/crates/openhuman-core/src/channels/providers/README.md b/crates/openhuman-core/src/channels/providers/README.mdindex 12188b6bde..5847a14981 100644--- a/crates/openhuman-core/src/channels/providers/README.md+++ b/crates/openhuman-core/src/channels/providers/README.md@@ -1,6 +1,6 @@# Providers-Implementations live in `vendor/tinychannels/src/providers/`, not here. Every flat file in this directory except `mod.rs` is a one-line `pub use tinychannels::providers::<name>::*;` (or a narrower named re-export: `signal`, `slack`, `whatsapp`, `whatsapp_web`) that keeps the stable `crate::channels::providers::<name>` path, and via `channels/mod.rs` the shorter `crate::channels::<name>` path, resolving after the extraction. Verify with `grep -L 'tinychannels::providers' providers/*.rs`, which should print only `mod.rs`. Provider construction is upstream too: `runtime/startup.rs` calls `tinychannels::build_channels` with a credential-hydrated config and the `channels::host` capability surface.+Implementations live in `vendor/tinychannels/src/providers/`, not here. `mod.rs` re-exports each provider module from `tinychannels::providers`, which keeps the stable `crate::channels::providers::<name>` path, and via `channels/mod.rs` the shorter `crate::channels::<name>` path. Provider construction is upstream too: `runtime/startup.rs` calls `tinychannels::build_channels` with a credential-hydrated config and the `channels::host` capability surface.## Providers@@ -17,30 +17,30 @@ Implementations live in `vendor/tinychannels/src/providers/`, not here. Every fl| `qq` | `QQChannel` | `channels` || `signal` | `SignalChannel` | `channels` || `slack` | `SlackChannel` | `channels` |-| `telegram` | `TelegramChannel` (+ host glue, below) | `channels` |+| `telegram` | `TelegramChannel` | `channels` || `whatsapp` | `WhatsAppChannel` | `channels` || `whatsapp_web` | `WhatsAppWebChannel` | `whatsapp-web` (forwards to `tinychannels/whatsapp-web`) || `yuanbao` | `YuanbaoChannel` | `channels` |-`CliChannel` is not a provider re-export: it lives in the ungated `channels/cli.rs` as a local `impl Channel`.+`CliChannel` is not a provider re-export: `channels/mod.rs` takes it from the ungated `tinychannels-runtime` crate.-## Telegram is the exception+## Capabilities, not provider special cases-`providers/telegram/mod.rs` re-exports the transport (`session_store`, `TelegramChannel`) from `tinychannels::providers::telegram`, but keeps three pieces here because they depend on the OpenHuman event bus and runtime rather than on transport:+What a provider can do beyond send/receive is declared once, upstream, in `tinychannels_bus::capabilities_for` (`ChannelCapabilities`): `remote_control`, `chat_approvals`, `progressive_edits` and `history_key_ignores_thread`. The host reads those flags instead of comparing channel names:-- `remote_control`: `/status /sessions /new` command handling (`TelegramRemoteCommand`), using the `ChannelRuntimeContext` and `web_chat::invalidate_thread_sessions`.-- `bus::TelegramRemoteSubscriber`: busy-state handler for `DomainEvent::ChannelMessageReceived` / `ChannelMessageProcessed`, subscribed to the process bus in `channels/runtime/startup/start_channels.rs`.-- `approval_surface::TelegramApprovalSurfaceSubscriber` (plus `TELEGRAM_APPROVAL_CLIENT_ID`): the approval surface for Telegram, subscribed in the same place. `runtime/dispatch/processor.rs::channel_has_approval_surface` returns `true` only for `TELEGRAM_APPROVAL_CLIENT_ID`, so Telegram is currently the only channel whose yes/no replies reach the `ApprovalGate`.+- `routes.rs` offers `/status`, `/sessions`, `/new` and `/help` (`tinychannels::remote`) where `remote_control` is set, backed by `host/remote_control.rs`.+- `runtime/dispatch/processor/approval.rs` scopes turns in an `ApprovalChatContext` and intercepts `yes`/`no` replies where `chat_approvals` is set; `host/channel_events.rs::ChannelApprovalSurfaceSubscriber` sends the prompt (`tinychannels::approvals`).+- `host/channel_events.rs::ChannelTurnStateSubscriber` records busy state for `/status`.+- `bus/`'s progressive reply shows draft, thinking and filler bubbles only where `progressive_edits` is set.Ported providers reach host capabilities (voice, approvals, conversation history, shutdown, event sink) through the `tinychannels::host::ProviderContext` built by `channels::host::build_provider_context` instead of calling OpenHuman internals directly; see `channels/host/mod.rs`.## Adding a provider-Provider transport and registration (`ChannelDefinition` metadata in `tinychannels::controllers`) belong upstream in `vendor/tinychannels`. Once a provider exists there:+Provider transport, registration (`ChannelDefinition` metadata in `tinychannels::controllers`) and its capability entry belong upstream in `vendor/tinychannels`. Once a provider exists there:-1. Add `pub mod <name>;` to `providers/mod.rs` and the one-line `pub use tinychannels::providers::<name>::*;` file here.+1. Add it to the `pub use tinychannels::providers::{...}` list in `providers/mod.rs`.2. Add the matching `pub use providers::<name>` / `pub use <name>::<Name>Channel` pair to `channels/mod.rs`.3. If the provider's secret lives outside `config.toml` (keyring or env), extend `hydrate_channel_credentials` in `runtime/startup/credentials.rs` the way `email` and `yuanbao` do; `tinychannels::build_channels` expects an already-hydrated config.-4. If the provider needs host-coupled glue that must stay in OpenHuman (event bus subscribers, runtime-context command handling), follow the Telegram pattern: keep the glue in a submodule here and re-export the transport from `tinychannels`.-Do not reimplement provider transport logic in this crate; `tinychannels::build_channels` and the shared config schema will not pick it up.+Do not reimplement provider transport logic, or branch on a provider name for behaviour a capability flag describes; add the flag upstream instead.diff --git a/crates/openhuman-core/src/channels/runtime/README.md b/crates/openhuman-core/src/channels/runtime/README.mdindex 53351f5981..127c925fa8 100644--- a/crates/openhuman-core/src/channels/runtime/README.md+++ b/crates/openhuman-core/src/channels/runtime/README.md@@ -13,12 +13,12 @@ Boots every enabled channel, keeps their listeners alive, and dispatches inbound## Account lifetime-Model authentication and account lifetime are separate. A local or CLI model can run without an OpenHuman backend session, but explicit logout cancels the old account's channel runtime. `spawn_channels_service` captures the channel lifetime before awaiting config loading, so logout also cancels a partially started runtime. `session.rs` stops the runtime on invalidation; owned listener/bridge tasks, dispatch workers, draft updaters, typing tasks, and relay reconnect supervision terminate when their owners drop. A runtime explicitly started again obtains a fresh lifetime; logout does not automatically start listeners for another account.+Model authentication and account lifetime are separate. A local or CLI model can run without an OpenHuman backend session, but explicit logout cancels the old account's channel runtime. `spawn_channels_service` captures the channel lifetime before awaiting config loading, so logout also cancels a partially started runtime. `session.rs` holds the process's `tinychannels::runtime::ChannelSession` and stops the runtime on invalidation; owned listener/bridge tasks, dispatch workers, draft updaters, typing tasks, and relay reconnect supervision terminate when their owners drop. A runtime explicitly started again obtains a fresh lifetime; logout does not automatically start listeners for another account.## Inbound path1. Each provider listener (`spawn_supervised_listener`, one per channel from `tinychannels::build_channels`) sends `traits::ChannelMessage`s on a bounded `mpsc` (capacity 100). A bridge task in `startup/start_channels.rs` wraps each into `RuntimeChannelMessage` and forwards it to the dispatch queue (also capacity 100). The relay runtime (`start_relay_runtime`) writes `RuntimeChannelMessage`s to that queue directly so relay inbound keeps its original TinyChannels envelope.-2. `run_message_dispatch_loop` (`dispatch/processor/dispatch_loop.rs`) drains the queue under a semaphore sized by `compute_max_in_flight_messages(listener_count)` and spawns a worker per message that calls `process_channel_runtime_message` (`processor/turn.rs`). `process_channel_message` is the `traits::ChannelMessage` wrapper for the same pipeline.+2. `run_message_dispatch_loop` (`dispatch/processor.rs`, over `tinychannels::runtime::run_dispatch_loop`) drains the queue under a semaphore sized by `compute_max_in_flight_messages(listener_count)` and spawns a worker per message that calls `process_channel_runtime_message` (`processor/turn.rs`). `process_channel_message` is the `traits::ChannelMessage` wrapper for the same pipeline.3. `process_channel_runtime_message` publishes `DomainEvent::ChannelMessageReceived`, then: if `channel_has_approval_surface` and `try_route_approval_reply` claims the message as a yes/no answer to a parked approval, stops there; otherwise starts typing, sends the ACK reaction (`select_acknowledgment_reaction`, threaded messages only), opens a streaming draft when the channel supports it, resolves scoping (`resolve_target_agent` + `build_visible_tool_set`), dispatches the turn over `BUS.native()` to the `agent.run_turn` handler (`agent::bus::register_agent_handlers`), sends the reply, and publishes `DomainEvent::ChannelMessageProcessed`.## `dispatch/`@@ -27,10 +27,10 @@ Model authentication and account lifetime are separate. A local or CLI model can| --- | --- || `helpers.rs` | Stateless helpers: per-turn context block for non-web channels, deterministic ACK-emoji picker, worker join logging, scoped typing task || `routing.rs` | `AgentScoping`, `resolve_target_agent`, `build_visible_tool_set`, `connected_with_fallback`: picks the active agent for the channel and its visible/delegation tool surface from `Config`, `AgentDefinitionRegistry`, and the connected-integrations snapshot |-| `processor.rs` (+ `processor/`: `message.rs`, `approval.rs`, `turn.rs`, `dispatch_loop.rs`) | `RuntimeChannelMessage`, `channel_has_approval_surface`, `try_route_approval_reply`, `process_channel_message`, `process_channel_runtime_message`, `run_message_dispatch_loop` |+| `processor.rs` (+ `processor/`: `approval.rs`, `turn.rs`) | `RuntimeChannelMessage` (re-exported from `tinychannels::runtime`), `channel_has_approval_surface`, `try_route_approval_reply`, `process_channel_message`, `process_channel_runtime_message`, `run_message_dispatch_loop` || `mod.rs` | Declares the three submodules and the `#[cfg(test)]` / `#[cfg(any(test, debug_assertions))]` re-exports the test modules reach through `super::*` |-Two policy points here: `channel_has_approval_surface` is `true` only for `TELEGRAM_APPROVAL_CLIENT_ID`, so other channels still run in the legacy "no chat context, silently allow" state until they get a surface subscriber; and scoping is per channel (`resolve_target_agent(&msg.channel)`), falling back to `AgentScoping::unscoped()` (every registered tool visible) when the registry is not initialised or the target agent is unknown.+Two policy points here: `channel_has_approval_surface` follows the provider's `chat_approvals` capability (every chat provider; not email, the CLI or webhooks, which keep the "no chat context, silently allow" behaviour); and scoping is per channel (`resolve_target_agent(&msg.channel)`), falling back to `AgentScoping::unscoped()` (every registered tool visible) when the registry is not initialised or the target agent is unknown.## Called by