Skip to content

Stream LLM responses to Slack instead of buffering full output #8

Closed as not planned

Description

@sentry-junior

Summary

Junior currently buffers the full LLM response before posting it to the Slack thread. This produces a dead UX where users stare at nothing until the entire answer arrives, then it dumps all at once. Streaming would post incremental updates as tokens arrive, so users see progress immediately.

Current Behavior

  • LLM response is fully buffered before any Slack message is sent.
  • Users experience no feedback for the full duration of inference (can be 10-30+ seconds for longer responses).
  • The complete message appears atomically once generation finishes.

Gap / Opportunity

  • Streaming makes the bot feel significantly more responsive and interactive.
  • Users can start reading and context-switching earlier, improving perceived latency.
  • It aligns with how modern AI chat products (ChatGPT, Claude.ai) behave.

Prior Art

  • Slack supports in-place message editing via chat.update, which is the standard pattern for simulating streaming: post a placeholder, then repeatedly update it as tokens arrive.
  • Vercel AI SDK Slackbot template demonstrates this pattern: post initial message → stream tokens → call chat.update on a throttled cadence to avoid rate limits.
  • bolt-js community has tracked this need (Slack - Support of LLM streaming slackapi/bolt-js#2073); common solution is a debounced update loop driven by the LLM stream.

Options

  • Option A – Debounced chat.update loop: Post placeholder on first token, accumulate streamed tokens, flush to Slack every ~500ms or N tokens. Simple; handles rate limits naturally.
  • Option B – Chunk-batched updates: Buffer N tokens per update (e.g. 50 tokens), call chat.update per batch. Predictable cadence; slightly choppier UX than Option A.
  • Option C – Socket Mode + streaming: If junior uses Socket Mode, combine with Option A for lower-latency delivery with no HTTP timeout risk.

Recommended Direction

Option A (debounced chat.update loop) — easiest to implement, naturally self-throttles against Slack's Tier 3 rate limit (~50 req/min per channel), and matches the dominant pattern in the ecosystem.

Acceptance Criteria

  • Users see a partial message appear within ~1s of LLM generation starting.
  • Message content updates progressively as tokens stream in.
  • Final message state matches full LLM output with no dropped tokens.
  • chat.update call rate stays within Slack API tier limits (no ratelimited errors under normal usage).

Risks

  • Slack chat.update rate limits (Tier 3: ~50 req/min per channel) — mitigated by debouncing at ≥500ms intervals.
  • Partial message edits can look jarring mid-sentence — acceptable tradeoff for responsiveness.

Activity

  1. dcramer commented on Feb 27, 2026

    @dcramer
    Member

    Actually this is working, i think it was just not obvious because it didnt stream until it was done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions