← Back to library

Slack chatStream 报 missing_recipient_*:补齐 recipient_team_id 与 recipient_user_id

问题/场景:Slack 流式回复失败并报 missing_recipient_team_id / missing_recipient_user_id。前置条件:已启用 Slack 渠道并使用 chatStream。实施步骤:确认报错 → 在 startSlackStream 入参透传 teamId/botUserId → 调用 client.chatStream 时填入 recipient_team_id/recipient_user_id → 重启并回归测试。关键配置:ctx.teamId、ctx.botUserId。验证:流式回复恢复且保留 Block Kit 富文本。风险:字段缺失时应回落非流式并标记需验证。来源:Issue #21213。

GITHUBDiscovered 2026-02-20Author floriansiebert
Prerequisites
  • Slack app is connected in OpenClaw and streaming reply path is enabled.
  • Runtime context can access teamId and botUserId (from Slack auth/session context).
Steps
  1. Reproduce the failure and confirm API errors include missing_recipient_team_id or missing_recipient_user_id.
  2. Update `startSlackStream` caller to pass `teamId` and `botUserId` from context.
  3. Build stream options with `recipient_team_id` and `recipient_user_id` before calling `client.chatStream`.
  4. Restart gateway and run stream + fallback (chat.postMessage) regression tests.
Commands
openclaw gateway restart
openclaw gateway status
npm run build
Verify

Slack replies stream successfully without missing_recipient_* errors, and rich formatting is preserved.

Caveats
  • If either ID is unavailable in context, fallback to non-streaming send and log explicit diagnostic fields.
  • Slack SDK parameter requirements may change across versions; pin and re-check after upgrades(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post