slackapi / slackapi/bolt-js

Feature Request: Support updating/editing stream content

Open
#2,697 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triage-skip enhancement server-side-issue
Dominant language
TypeScript
Stars
2.9k
Forks
445
Avg merge
1d 3h
Merged PRs (30d)
28

Description

Summary

Add API support for editing previously streamed content, enabling Slack bots to update live status indicators, TODO lists, and other dynamic content while streaming. Currently, chatStream() only supports appending new content - there's no way to modify what was already sent.

Use Case

Scenario: Live TODO List Updates

When an AI agent is working through a multi-step task:

  1. Show TODO list at the top of the message
  2. Stream tool outputs below
  3. Update TODO items in real-time as agent completes them:
    • Analyze requirements
    • 🔄 Generate code
    • ⏸️ Run tests
    • ⏸️ Deploy

Current limitation: Must append new content, creating messy repeated lists:

TODO:
- Step 1
- Step 2
- Step 3

[agent output...]

TODO:
- ✅ Step 1
- Step 2
- Step 3

[more output...]

TODO:
- ✅ Step 1
- ✅ Step 2
- Step 3

Proposed API

Option 1: Named content sections
const streamer = client.chatStream({
  channel: CHANNEL,
  thread_ts: thread,
  recipient_team_id: team,
  recipient_user_id: USER,
  sections: {
    header: "**TODO List**\n- ⏸️ Step 1\n- ⏸️ Step 2\n- ⏸️ Step 3",
    content: ""
  }
});

// Update header section (replaces previous content)
await streamer.update({
  section: "header",
  markdown_text: "**TODO List**\n- ✅ ~~Step 1~~\n- 🔄 Step 2\n- ⏸️ Step 3"
});

// Append to content section (existing behavior)
await streamer.append({
  section: "content",
  markdown_text: "\n\nStep 1 complete: Generated code"
});
Option 2: Full content replacement with diff
const streamer = client.chatStream({
  channel: CHANNEL,
  thread_ts: thread,
  recipient_team_id: team,
  recipient_user_id: USER,
  markdown_text: "Initial content"
});

// Replace entire message content
await streamer.replace({
  markdown_text: "Updated content",
  preserve_scroll: true // Don't jump to top
});

Real-World Examples

1. Progress Indicator
🔄 Processing (2/5 steps)
━━━━━━━━━━░░░░░░░░░░ 40%

[agent output below]
2. Live Metrics
📊 Analysis Status
- Files analyzed: 42
- Issues found: 3
- Time elapsed: 12s

[detailed findings below]
3. Dynamic Summary
💡 Summary: Analyzing codebase...
   → Found authentication bug in auth.ts:42

[full analysis below]

Expected Behavior

When content is updated (not appended):

  1. Slack replaces the specified section in-place
  2. Scroll position is preserved (user isn't jumped around)
  3. New content smoothly transitions in
  4. Bot receives confirmation of update

Current Workaround

Currently, bots must:

  1. Use separate messages for status (splits context)
  2. Post new message after stream completes (delayed feedback)

None of these approaches provide real-time, in-place updates.

Environment

  • @slack/bolt: 4.5.0
  • @slack/web-api: 7.11.0
  • Platform: Slack Desktop App (macOS) / Slack Web

Implementation Considerations

Potential challenges:

  • Message edit history/versioning
  • Race conditions with concurrent updates
  • Scroll position preservation
  • Performance with frequent updates

Suggested limits:

  • Max update frequency: 2-3 per second
  • Max section size: reasonable limit to prevent abuse
  • Clear documentation on when to use update vs append

Benefits

  1. Better UX: Users see live progress without scrolling
  2. Context preservation: Status stays at top, outputs below
  3. Reduced clutter: No repeated TODO lists or status lines
  4. Professional appearance: Clean, polished streaming experience
  5. Competitive parity: Other chat AI tools (ChatGPT, Claude) support this

Related Patterns

Similar update patterns in:

  • ChatGPT's web interface (streaming with live status)
  • Claude's web interface (thinking blocks that update)
  • VS Code Live Share (real-time collaborative editing)
  • Google Docs (operational transform for concurrent edits)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing chatStream API entry point and reviewing its append behavior; the payload names no source files or tests. Compare the requested section update and full replacement options against the current Slack streaming capabilities. Done means an agreed API design, documented update semantics and limits, and coverage for replacement, append, scrolling, confirmations, and concurrency.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.