Channel Setup
Loong keeps channel setup explicit so operators can tell what is actually shipped, what is gateway-supervised, what stays on a standalone native serve loop, what is bridge-owned, what is outbound-only, and what still depends on future runtime work. Use this page when you want the practical setup contract. If you want step-by-step smoke tests and worked examples instead, start with Channel Guides for the exact per-surface contract, then keep Channel Recipes for representative rollout patterns. If you want the shared public config shape before the per-surface setup rules, start with Configuration Patterns. If you specifically need the longer-lived owner model, foreground versus headless supervision, or--channel-account selectors, continue to
Gateway And Supervision.
Canonical Channel Command Story
Public docs now use grouped channel shells first:- generic sends:
loong channels send <surface> ... - generic serve loops:
loong channels serve <surface> ... - richer family namespaces stay first-class when they expose more than thin wrappers, but the canonical channel contract still uses
loong channels send <surface>andloong channels serve <surface>
Start With The Right Question
Readiness Rules
Before any channel is really ready:- the base CLI path should already work locally
- provider credentials should already be healthy
- channel-specific credentials should already resolve
- the surface should be described truthfully as gateway-supervised, standalone native-serve, plugin-backed, or outbound-only
- setup should point to a concrete operator path instead of a vague support claim
Common Rollout Shapes
Gateway-Supervised Service Channels
These are the shipped reply-loop surfaces that can joingateway run or
gateway run today.
Standalone Native-Serve Surfaces
These surfaces ship real built-in serve loops, but the runtime still stays on the directchannels serve <surface> command instead of gateway supervision.
Plugin-Backed Bridge Surfaces
These surfaces are shipped as real channel contracts, but the listener, login, and upstream session lifecycle stay in an external bridge or managed plugin.
Operational rule:
- these surfaces are actionable and operator-visible today
- they do not join
gateway runorgateway runbecause their runtime owner is still the external bridge - the important setup milestone is a passing contract + discovery result, not a native runtime loop that does not exist yet
- managed bridge command execution also requires
[runtime_plugins].enabled = trueplus one or moreruntime_plugins.roots - grouped
channels serve <surface>flows retry transient managed bridge runtime failures locally with bounded backoff before surfacing a hard failure - retry/failure metadata is surfaced through
loong doctorandloong channels, so operators can see when a bridge is actively retrying instead of guessing from stderr
Multi-Account Rule
- use
default_accountwhen one account should be the normal default lane - use
accounts.<id>when one config should hold prod, backup, or environment-specific credentials - keep shared defaults at the top level and override only account-specific secrets or allowlists
feishuis the canonical config block for the Feishu family, whilelarkremains an accepted operator-facing alias in selectors and references- gateway selectors should target those configured
accounts.<id>values rather than ad-hoc names invented at command time
Feishu / Lark
Feishu supports two inbound transport shapes:- webhook mode
- websocket mode
- both modes need the base app credentials and trusted-chat boundary
- webhook mode also needs the webhook verification material
- websocket mode should not be documented as if webhook-only secrets are mandatory
loong channels send feishuandloong channels serve feishuare the canonical first-class shipped channel commands
Telegram
Telegram remains the simplest shipped bot lane:- enable the channel
- provide one bot token
- allowlist trusted chat ids
- use
loong channels serve telegramfor reply-loop automation - use
loong channels send telegramfor direct proactive sends
Matrix
Matrix is a sync-loop surface:- configure the homeserver URL and access token
- allowlist trusted room ids
- use
loong channels send matrixfor direct room delivery - use
loong channels serve matrixfor the reply loop
WhatsApp Cloud API
The current WhatsApp business lane is a Cloud API plus verified webhook runtime surface:- configure
access_tokenandphone_number_idfor direct sends - configure
verify_tokenandapp_secretfor the webhook-backed serve path - use
loong channels send whatsappfor proactive sends - use
loong channels serve whatsappfor the reply loop - keep
webhook_bindandwebhook_pathexplicit so the callback owner is legible - keep this Cloud API credential flow separate from the QR-linked WhatsApp Personal path so operators can tell whether they need Meta business credentials or a scan-to-link setup
WeCom
WeCom is documented as the official AIBot long-connection lane:- configure
bot_idandsecret - allowlist trusted conversation ids
- use
loong channels serve wecomfor the long-lived reply loop - use
loong channels send wecomfor proactive sends
Weixin
Weixin is a bridge-first surface:- start with
loong weixin onboardwhen you want Loong to request the iLink QR code and save the resultingbridge_urlplusbridge_access_tokenfor you - configure
bridge_urlplusbridge_access_token - keep
allowed_contact_idsexplicit because the bridge contract should stay narrow - optional
managed_bridge_plugin_idis the tie-breaker when several compatible managed bridges are installed - use
loong doctorto verify the configured contract and the selected managed bridge - use
loong channelsorloong channels --jsonto inspect stable targets and discovery state - use
loong channels send weixin --target contact:<id>orloong channels send weixin --target weixin:<account>:room:<id>for proactive sends - use
loong channels serve weixinto run the selected managed bridge reply loop under Loong supervision - use
loong channels serve weixin --stopto request cooperative shutdown for the selected managed bridge runtime owner - Loong automatically asks older duplicate owners to stop when it can identify one clear preferred runtime owner
- use
loong channels serve weixin --stop-duplicatesas the operator fallback when duplicate live owners persist and you want Loong to keep the preferred runtime owner while requesting cooperative shutdown for the older duplicates
QQ Bot
QQ Bot is the explicit Tencent gateway runtime lane:- configure
app_idplusclient_secret - use
allowed_peer_idsto keep the trusted conversation boundary explicit - keep openids and account ids stable so direct, group, and guild routes do not drift between bridge implementations
- use
loong channels send qqbot --target c2c:<openid>,group:<openid>, orchannel:<id>for proactive sends - use
loong channels serve qqbotto run the native QQ gateway reply loop under Loong supervision
OneBot
OneBot is the protocol-level bridge lane:- configure
websocket_urlplusaccess_token - keep
allowed_group_idsexplicit so the bridge contract stays narrow - use it when the upstream bridge already speaks OneBot v11 and you want Loong to own the stable surface id and target contract
- verify bridge discovery through
loong doctorbefore you treat the surface as ready - use
loong channels send onebot --target private:<user_id>orloong channels send onebot --target group:<group_id>for proactive sends - use
loong channels serve onebotto run the selected managed bridge reply loop under Loong supervision - use
loong channels serve onebot --stopto request cooperative shutdown for the selected managed bridge runtime owner - Loong automatically asks older duplicate owners to stop when it can identify one clear preferred runtime owner
- use
loong channels serve onebot --stop-duplicatesas the operator fallback to clean up duplicate live runtime owners without fully draining the preferred owner
Outbound-Only Surfaces
These surfaces ship direct-send behavior, config validation, and inventory metadata without claiming a full reply-loop runtime.Outbound HTTP Trust Rules
For HTTP-backed outbound delivery:- URLs should use
httporhttps - credentials should not be embedded in the URL itself
- private or special-use hosts are blocked by default
- redirects are not followed automatically
Gateway And Multi-Channel Ownership
When you move beyond one local surface:gateway run,gateway status, andgateway stopare the explicit owner contractgateway runis the compatibility wrapper for the shipped gateway-supervised subset- standalone native-serve surfaces use their own
channels serve <surface>loop instead of joining the same reply-loop runtime contract - plugin-backed surfaces are inspected through
doctorandchannels, not supervised through the same reply-loop runtime contract - outbound-only surfaces should not be described as if they are supervised by the same reply-loop runtime contract
- the detailed command model, selector syntax, and recovery loop live in Gateway And Supervision
Recommended Progression
- Get the local assistant path healthy first.
- Add one gateway-supervised service channel if you need the shortest path into
gateway runorgateway run. - Add one standalone native-serve surface when you need a real built-in
channels serve <surface>loop without gateway supervision yet. - Add one plugin-backed bridge surface when the ecosystem is real but the runtime owner should stay external.
- Add outbound-only surfaces when you need governed direct sends.
- Reach for gateway and
gateway runonly after one gateway-supervised channel already works cleanly.
Deep References
- Continue to Channel Guides for the full actionable channel matrix.
- Continue to Channel Recipes for tutorial-style demos built on top of this setup contract.
- Continue to Channels for the conceptual public-surface model.
- Continue to Gateway And Supervision for the current runtime owner contract and multi-channel selection rules.
- Continue to Use Loong for the broader operator-facing runtime contract.
- The repository still keeps the full field-level source spec in Channel Setup.