Skip to main content

Module channels

Module channels 

Source
Expand description

ORCH-14 — the channel noun at the OBSERVED tier: one uniform row per transport + account a gateway harness is reachable on, read from the harness’s own config file and never written.

Two sources, one row shape:

  • Hermes — the platform blocks of HERMES_HOME/config.yaml, keyed by gateway.config.Platform values (telegram, slack, discord, api_server, webhook, …) and carrying enabled, extra.* and the platform’s own credential keys. load_gateway_config merges FOUR places into one map, so all four are read — see [hermes_rows]. Hermes also enables a platform from the ENVIRONMENT alone (_apply_env_overrides), so a platform with no config block but with its credential env var set is reported too — by the var’s PRESENCE, never its value.
  • OpenClawchannels.<name> in <openclaw home>/openclaw.json (JSON5), with channels.<name>.accounts splitting a channel into one row per account id.

Claude Code is deliberately absent. Its channels are MCP servers that declare the channel capability over the MCP protocol at connect time (docs/composable-harness/inventory/claude-code.md §7 “Channels”: the channel contract is “capability declaration, notification events, reply tools, sender gating, permission relay”). Nothing in settings.json or .mcp.json marks a server as a channel — channelsEnabled and allowedChannelPlugins are enterprise GATES, not declarations — so supercode cannot tell a channel server from any other MCP server without connecting to it. Guessing a key name would fabricate rows, so claude-code is refused with ChannelError::UnsupportedHarness.

§Secrecy

This module never emits a token, key, secret or password, and never reads one to decide anything but PRESENCE. Two mechanisms enforce that:

  • values are read only for key names on HERMES_ACCOUNT_KEYS / OPENCLAW_ACCOUNT_KEYS — public identifiers (app_id, client_id, phone_number_id, …), never a credential;
  • configured is decided by [is_credential_key], which looks at the key NAME only, and by std::env::var_os(..).is_some() for the env fallbacks — the value never leaves the check.

Everything here is read-only: no harness home is created or written. A harness with no channel concept is refused, never answered with an empty list.

Structs§

ChannelRow
One transport + account a harness is reachable on, uniform across harnesses.

Enums§

ChannelError
Read-only channel failures.
ChannelStatus
Whether a live probe answered, and what it said.

Constants§

CHANNELS_SCHEMA
Stable row schema shared by Rust, JSON-RPC, the SDKs, and the CLI.
CHANNEL_HARNESSES
Harnesses with a channel concept supercode reads, in product order. Every other harness id is ChannelError::UnsupportedHarness.
HERMES_ACCOUNT_KEYS
Key names whose VALUE is a public account identifier, safe to emit. Read from a Hermes platform block’s extra first, then its top level. Nothing outside this list is ever read for a value.
HERMES_PLATFORMS
Every key name that parses as a Hermes Platform, so a config key can be told apart from an ordinary setting.
OPENCLAW_ACCOUNT_KEYS
Key names whose VALUE is a public account identifier in an OpenClaw channel entry. The accounts MAP’s keys are account ids in their own right and are used first; this list covers a single-account entry that names its account inline.

Functions§

channel_status
Read one channel’s row by harness and name. status is ChannelStatus::Unknown at this tier for every harness; the verb exists so the noun is complete and the driven tier has one door to fill.
list_channels
List every channel supercode can see, optionally restricted to one harness. Rows are ordered by harness (as in CHANNEL_HARNESSES) then by name.