文档导航
文档 / Channels

Channels

channel 让 OpenSquilla 可以从消息平台运行,同时与 CLI 和 Web UI 共享同一套 agent 运行时。当你希望同一个 agent 能从 Slack、Telegram、Feishu/Lark、Discord、DingTalk、WeCom、Matrix、QQ 或其他受支持的适配器进行回复时,请使用 channel。

支持的 channel 类型

查看本地安装:

opensquilla channels types
opensquilla channels types --json
opensquilla channels describe feishu

该构建提供以下 channel 系列:

Type标签Transport是否需要公网 URL
dingtalkDingTalkwebsocket
discordDiscordwebsocket
feishuFeishu / Larkmixed视模式而定
matrixMatrixwebsocket
qqQQ Botwebsocket
slackSlackmixed视模式而定
telegramTelegrammixed视模式而定
wecomWeComwebhook

本地 channels describe <type> 的输出是必填字段、密钥、扩展字段以及重启行为的权威来源。

配置流程

交互式配置:

opensquilla configure channels

显式添加一个 channel:

opensquilla channels add telegram --name personal

按需添加 provider 相关字段。Slack 支持两种模式:

# Slack Socket Mode:出站 websocket,无需公网 URL。
opensquilla channels add slack --name team \
  --field connection_mode=socket \
  --field app_token=xapp-... \
  --token xoxb-...

# Slack Events API webhook:需要公网 Request URL 以及 signing secret。
opensquilla channels add slack --name team-webhook \
  --field connection_mode=webhook \
  --field signing_secret=... \
  --token xoxb-...

配置修改后请重启 gateway 进程:

opensquilla gateway restart

验证运行时连接:

opensquilla channels status
opensquilla channels status personal --json

保存 channel 证明配置已被写入。channels status 则证明运行中的 gateway 是否成功加载并连接了该 channel。

管理 channel

opensquilla channels list
opensquilla channels enable <name>
opensquilla channels disable <name>
opensquilla channels edit <name>
opensquilla channels restart <name>
opensquilla channels logout <name>
opensquilla channels remove <name>

配置变更后请使用 gateway restart。仅对已加载的运行中适配器使用 channels restart <name>

Slack 模式

Slack Socket Mode 使用出站 websocket,不需要公网 Request URL。它需要 bot token(xoxb-...)以及一个保存为 app_token 的 app-level token(xapp-...)。

Slack webhook 模式使用 Events API Request URL。它需要 bot token 加上 signing_secret,且 gateway 必须可被 Slack 访问。

当适配器应回复来源会话时,将 slack_channel_id 留空。仅当你希望设置一个默认回退 channel 时才设置它。当回复应保留在 Slack 线程中时,启用 reply_in_thread

Webhook channel

Slack webhook 模式和 WeCom 需要一个公网可达、provider 可访问的 URL。Feishu 与 Telegram 可能也需要,视模式而定。

对于公网 channel:

  • 将 gateway 绑定到可达的网络接口;
  • 将其置于可信的反向代理或隧道之后;
  • 配置鉴权;
  • 仔细核对 provider 的回调 URL 与密钥。

受控网络中的绑定示例:

opensquilla gateway run --listen 0.0.0.0 --port 18791

不要将未鉴权的 gateway 暴露到公网。

附件与 artifact

各 channel 适配器在附件与 artifact 投递行为上可能有所不同。OpenSquilla 通过同一套运行时路径标准化 agent 执行,但平台 transport 仍会控制文件大小限制、消息线程以及上传/下载能力。

当某个 channel 无法直接投递大体积 artifact 时,使用 Web UI 的 artifact 卡片或 session 导出作为恢复路径。

排障

如果某个 channel 没有响应:

  1. 检查配置项:

    opensquilla channels list
  2. 检查运行时状态:

    opensquilla channels status <name> --json
  3. 配置变更后重启 gateway 进程:

    opensquilla gateway restart
  4. 对 webhook channel,确认公网 URL、provider 回调密钥以及 gateway 鉴权/网络边界。


文档索引 · 产品指南 · 改进本页 · 反馈文档问题

在 GitHub 上编辑此页(英文原稿) OpenSquilla 文档 · 中文社区翻译