Configuration Patterns
Use this page when you want the public config shape without reading the full source-level spec. This page is intentionally about patterns, not every field. It should help you recognize how Loong’s config is organized before you drop into provider guides, channel guides, rollout recipes, or the repository-native product specs.Start With The Right Question
| If you need… | Start here |
|---|---|
| one provider profile that should own first value | Single Provider Profile |
| several explicit provider lanes in one file | Multi-Profile Provider Config |
| one service-channel account that should own a reply loop | Single-Account Channel Shape |
| several channel accounts with stable selector ids | Multi-Account Channel Shape |
gateway run or multi-channel-serve selectors | Gateway Selector Rule |
| managed skill install, exposure, and persisted download policy | Managed Skills |
| built-in web or browser private-host and domain rules | Browser And Web Boundaries |
| outbound sends to a private bridge or self-hosted HTTP endpoint | Outbound HTTP Trust Toggle |
| the current public memory shape | Memory Profile Shape |
Public Top-Level Shape
Loong keeps the top-level operator config explicit:active_providerchooses the current provider laneproviders.<id>stores reviewed provider profiles- channel families such as
feishu,telegram, orwecomkeep their own account-aware config blocks external_skillskeeps managed skill enablement and download policy explicittools.browser,tools.web, andtools.browser_companionkeep browser session limits, trust boundaries, and companion policy explicit instead of hiding them in helper scriptsmemory.profilestays operator-visible instead of hiding behind prompt logic- top-level runtime toggles such as
outbound_httpstay explicit
api_key = { env = "ARK_API_KEY" }is an explicit env-backed secret reference.api_key = "ARK_API_KEY"would be parsed as an inline literal, not as an env name lookup.${ARK_API_KEY}can also work, but the docs prefer{ env = "..." }because it is clearer and consistent withfileandexecsecret references.
- Managed Skills covers
[external_skills]enablement, install policy, and browser preview bootstrap. - Browser And Web Boundaries
covers
[tools.browser],[tools.web],[tools.browser_companion], and when[outbound_http] allow_private_hosts = trueis the right owner.
Skills And Browser Boundary Shape
When theconfig.toml question is really about managed skills, browser
enablement, or domain restrictions, the public shape looks like this:
[external_skills]governs managed skill discovery, download approval, install location, and runtime exposure policy[tools.browser]governs built-in browser enablement and local session, link, and text limits[tools.web]governs built-in web fetch and built-in browser host and domain trust[tools.browser_companion]governs the managed companion runtime lane[outbound_http]governs HTTP-backed outbound delivery, not the built-in browser
Single Provider Profile
Use one provider profile when one hosted or local lane should own the current runtime.- keep the provider id stable instead of rewriting it for every experiment
- use
model = "auto"only when discovery is actually useful for that lane - treat
preferred_modelsas an explicit fallback path, not a hidden override
Multi-Profile Provider Config
Use several profiles when cost, quota, latency, region, or coding traffic should stay explicit in one config file.active_providershould name the default runtime lane- profile ids should describe purpose, not just vendor
- coding-plan lanes should stay separate from the general hosted lane
- local or gateway-backed lanes belong in the same profile system rather than a separate ad-hoc config story
Single-Account Channel Shape
Start with one account when one service-channel or outbound-only identity should own the lane. Feishu / Lark example:- keep one explicit account first
- only move to selectors after the basic
*-serveor*-sendpath is already healthy
Multi-Account Channel Shape
Use named accounts before you introduce gateway selectors or environment-specific routing.- use
default_accountwhen one account should be the normal lane - use
accounts.<id>when one config should hold prod, backup, or environment-specific identities - keep selector ids stable and human-readable, such as
work,alerts, orbot_123456
Gateway Selector Rule
Selectors should resolve against configured account ids, not names invented at command time.lark=workis accepted as an alias for the Feishu family- one channel family should appear only once in the selector list
- selectors should target
accounts.<id>entries that already exist in config default_accountshould stay explicit so fallback routing is not accidental
Outbound HTTP Trust Toggle
HTTP-backed outbound delivery blocks private or special-use hosts by default. Widen that boundary explicitly when you really do want a private bridge or self-hosted endpoint.- loopback bridges
- RFC1918 or other private-network endpoints
- self-hosted services that should stay inside the trusted network boundary
Memory Profile Shape
Memory stays a small, operator-visible runtime choice.| Profile | Use it when |
|---|---|
window_only | you want the safest default and no durable profile memory |
window_plus_summary | one conversation should stay coherent across a longer span |
profile_plus_window | repeated sessions need durable operator context |
Reading Rules
- Use this page for shared public config shape, not every field.
- Use guide pages when you need the exact built-in contract for one provider or channel.
- Use recipe pages when you need representative commands, smoke tests, or rollout order.
- Use repository-native product specs when you need the exact source-level contract behind the public docs.
Continue Reading
| If you want to… | Go here |
|---|---|
| choose the provider lane first | Providers And Models |
| follow provider-specific config walkthroughs | Provider Guides and Provider Recipes |
| understand the delivery-surface model first | Channels |
| manage skill install and exposure policy | Managed Skills |
| debug private-host, domain, or browser runtime gates | Browser And Web Boundaries |
| follow channel setup and smoke-test paths | Channel Guides, Channel Recipes, and Channel Setup |
| choose between foreground serve loops and gateway ownership | Gateway And Supervision |
| inspect the source-level public contract | the repository-native Channel Setup spec |