Gateway And Supervision
Use this page when one service channel already works and you need to decide how Loong should own longer-lived delivery. If you still need initial channel setup or smoke tests, start with Channel Guides for the exact one-surface contract and keep Channel Recipes for the representative rollout path. This page is about runtime ownership, supervision, and account selection after the basic lane is already healthy. If you first need the shareddefault_account, accounts.<id>, or outbound
trust config shape, start with
Configuration Patterns.
Choose The Right Owner Shape
| Need | Best command | Why |
|---|---|---|
| keep one service channel in the foreground while you verify it | loong <surface>-serve | simplest single-surface loop; no cross-channel supervisor yet |
| keep several runtime-backed channels attached to one foreground shell | loong multi-channel-serve --session <name> | compatibility wrapper for operators who want one visible CLI-first session |
| claim the persisted owner slot and manage it from another process | loong gateway run | explicit owner contract with status and stop |
| claim gateway ownership and also attach a named CLI host | loong gateway run --session <name> | same owner contract, plus an attached concurrent CLI session |
Current Public Ownership Model
gateway run,gateway status, andgateway stopare the current explicit owner contract for longer-lived runtime-backed delivery.multi-channel-serveuses the same ownership model while preserving the attached foreground workflow many operators want during rollout.multi-channel-serveis still the compatibility wrapper, not the long-term product noun.- This ownership model is for runtime-backed service channels. It is not the umbrella story for every outbound integration in the catalog.
What Gateway Supervision Includes Today
Included in runtime supervision today:- Feishu / Lark
- Telegram
- Matrix
- WeCom
- Webhook and Email
- Slack, Discord, Teams, Google Chat, Mattermost, Nextcloud Talk, and Synology Chat
- LINE, DingTalk, Signal, IRC, iMessage / BlueBubbles, Nostr, Tlon, Twitch, and similar outbound-only surfaces
Channel-Account Selectors
Use repeatable--channel-account <CHANNEL=ACCOUNT> selectors when you want to
pin a specific account for a runtime-backed channel family.
Rules that matter:
feishu=workis valid, andlark=workis the accepted alias for the same Feishu family.- selectors should target configured account ids such as
work,alerts,bot_123456, orbridge-sync - one channel family can appear only once in the selector list; duplicate overrides are rejected
- malformed selectors such as
telegrambot123fail because the syntax must beCHANNEL=ACCOUNT - when a channel family has several configured accounts, setting
default_accountexplicitly keeps fallback routing from becoming accidental
Rollout Order
- Get
onboard,askorchat, anddoctorhealthy first. - Bring up one runtime-backed surface with its own
loong <surface>-serveloop before you introduce supervision. - Add
default_accountplusaccounts.<id>before you rely on multi-account supervision. - Use
multi-channel-servewhen you want one attached foreground session. - Use
gateway runwhen you want a persisted owner that another process can inspect or stop.
Recovery And Inspection
When startup or supervision is unclear, use the shortest diagnostic loop first:doctorchecks provider and channel readinesschannelsshows how Loong currently classifies each surfacegateway status --jsonis the quickest way to inspect current ownership from another CLI process
- confirm that the selected surface is actually runtime-backed, not outbound-only
- confirm that the selected account id exists under
accounts.<id> - rerun with explicit
--channel-accountselectors when a channel family has more than one configured account - check duplicate selectors first if startup fails immediately
Continue Reading
- Continue to Gateway Rollout when you want the owner contract turned into a rollout sequence.
- Continue to Common Setups when you want provider, channel, and gateway choices combined into one setup path.
- Continue to Configuration Patterns for the shared public account, selector, and trust-toggle config shapes.
- Go back to Channels for the surface model and runtime-backed versus outbound-only boundary.
- Continue to Channel Guides for the exact built-in contract of one shipped channel surface.
- Continue to Channel Setup for the practical public setup contract.
- Continue to Channel Recipes for smoke tests, worked examples, and rollout walkthroughs.
- The field-level public source spec remains in the repository’s Channel Setup markdown.