Skip to content

Feature Request: Support updating/editing stream contentΒ #2697

@buremba

Description

@buremba

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-triage-skipPrevent this issue from being closed due to lack of activityenhancementM-T: A feature request for new functionalityserver-side-issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions