Weixin
This is a shipped plugin-backed bridge surface. The channel contract is real and operator-visible, and Loong now ships a QR bootstrap flow for provisioning the sanctioned iLink bridge token and base URL. The long-lived listener still stays in an external bridge or managed plugin rather than a built-in Loongchannels serve <surface> runtime.
Recommended First Run
- requests a fresh WeChat / iLink QR code
- renders the QR directly in the terminal when possible
- polls until iLink returns the
bot_token,baseurl, and bound bot or user ids - writes
weixin.bridge_urlplusweixin.bridge_access_tokenintoloong.toml - bootstraps
allowed_contact_ids = ["<ilink_user_id>"]when that trust boundary is still empty
loong weixin onboard --account ops when you want the credentials written into weixin.accounts.ops.
At A Glance
| Field | Value |
|---|---|
| Catalog id | weixin |
| Config key | weixin |
| Implementation status | plugin_backed |
| Transport | wechat_clawbot_ilink_bridge |
| Aliases | wechat, wx, wechat-clawbot |
| Default send target kind | conversation |
| Runtime owner | external plugin |
Minimal Config
Smoke Test
loong channelslistsWeixin [weixin]under the plugin-backed sectionloong weixin onboardprints the saved bridge url plus the nextchannels serve weixincommand- the managed bridge discovery line selects one compatible plugin or explains exactly why discovery is incomplete or ambiguous
loong doctorreports the bridge contract as ready, or gives a bounded remediation path
Current Command Surface
| Operation | Current path | Usage or status |
|---|---|---|
| QR bridge bootstrap | weixin onboard | provisions bridge_url and bridge_access_token through the sanctioned iLink QR flow |
| managed bridge contract check | loong doctor | current readiness and remediation surface |
| inventory + discovery inspection | loong channels | current operator inventory surface |
| bridge-backed send | channels send weixin | executes through the selected managed bridge runtime; target contract stays weixin:<account>:contact:<id> or weixin:<account>:room:<id> |
| bridge-backed serve | channels serve weixin | starts the selected managed bridge reply loop; upstream session ownership still stays in the external bridge |
Required Fields For Bridge Send Contract
| Requirement | Config paths | Env pointer paths | Default env |
|---|---|---|---|
| channel enabled | weixin.enabledweixin.accounts.<account>.enabled | none | none |
| clawbot bridge url | weixin.bridge_urlweixin.accounts.<account>.bridge_url | weixin.bridge_url_envweixin.accounts.<account>.bridge_url_env | WEIXIN_BRIDGE_URL |
| bridge access token | weixin.bridge_access_tokenweixin.accounts.<account>.bridge_access_token | weixin.bridge_access_token_envweixin.accounts.<account>.bridge_access_token_env | WEIXIN_BRIDGE_ACCESS_TOKEN |
Required Fields For Bridge Reply Contract
| Requirement | Config paths | Env pointer paths | Default env |
|---|---|---|---|
| channel enabled | weixin.enabledweixin.accounts.<account>.enabled | none | none |
| clawbot bridge url | weixin.bridge_urlweixin.accounts.<account>.bridge_url | weixin.bridge_url_envweixin.accounts.<account>.bridge_url_env | WEIXIN_BRIDGE_URL |
| bridge access token | weixin.bridge_access_tokenweixin.accounts.<account>.bridge_access_token | weixin.bridge_access_token_envweixin.accounts.<account>.bridge_access_token_env | WEIXIN_BRIDGE_ACCESS_TOKEN |
| allowed contact ids | weixin.allowed_contact_idsweixin.accounts.<account>.allowed_contact_ids | none | none |
Stable Target Templates
Use these templates when you need one bridge implementation and later tooling to converge on the same route semantics.| Target | Meaning |
|---|---|
weixin:<account>:contact:<id> | direct contact conversation |
weixin:<account>:room:<id> | group room conversation |
Managed Bridge Discovery Notes
- Loong scans the configured managed install root for compatible bridge manifests.
- Managed bridge execution also requires
[runtime_plugins].enabled = trueplus one or moreruntime_plugins.roots. - If exactly one compatible bridge is found,
loong doctorandloong channelscan surface it as the selected plugin. - If several compatible bridges are found, set
managed_bridge_plugin_idto make the selection explicit. - If discovery is incomplete, Loong keeps the bridge-owned surface visible and reports the missing fields instead of pretending the channel is ready.
Gateway And Ownership
This surface does not joingateway run or gateway run today. The upstream Weixin listener and login flow remain owned by the external bridge.
Use Loong here for:
- the stable channel id and target contract
- config validation
- managed bridge discovery
- bounded operator diagnostics and remediation
Operator Notes
- Keep
allowed_contact_idstight. Treat it as the trust boundary, not a convenience list. loong weixin onboardis the recommended first-run path because it provisions the sanctionedbridge_urlandbridge_access_tokenpair without asking operators to copy the raw iLink response by hand.- Loong validates
allowed_contact_idslocally before forwarding a contact send through the managed bridge runtime. - If
allowed_contact_idsis still empty during QR onboarding, Loong bootstraps it with the scannedilink_user_idso the onboarding account can validate the lane immediately. channels serve weixinretries transient managed bridge runtime failures with bounded backoff; repeated failures still surface as a hard error so the bridge can be inspected.channels serve weixin --stoprequests a cooperative shutdown for the currently selected managed bridge runtime owner.- When duplicate runtime owners appear, Loong automatically keeps the preferred live runtime owner and requests cooperative shutdown for the older duplicates when the winner is clear.
channels serve weixin --stop-duplicatesremains the operator fallback when duplicate runtime owners persist and you want Loong to keep the preferred live runtime owner while draining the others.- While it is retrying,
loong doctorandloong channelssurface the current failure count and last bridge error. - QR onboarding does not install the bridge plugin for you. Managed bridge execution still needs
[runtime_plugins].enabled = true, one or moreruntime_plugins.roots, and either one compatible bridge or an explicitmanaged_bridge_plugin_id. - Prefer one explicit managed bridge per environment. If discovery is ambiguous, fix the ambiguity instead of relying on accidental selection.
- If you need multiple bridge identities, move to
default_accountplusaccounts.<id>before inventing ad-hoc routes.
Related Docs
- Continue to QQ Bot or OneBot if your Tencent or personal-account bridge lane uses a different upstream contract.
- Continue to Channel Guides for the full actionable matrix.
- Continue to Channels for the surface model.
- Continue to Channel Setup for the shared public setup contract.