Skip to content

chat_stream ignores username and icon_url override parameters (works in chat_postMessage) #1406

@scosenza

Description

@scosenza

Reproducible in:

slack-bolt==1.27.0
slack-sdk==3.38.0
Python 3.12.x

Steps to reproduce:

I'm currently using the new Slack chat_stream API to create an internal Slack bot for Airbnb employees. To repro this issue:

  1. Create a Slack bot app with the necessary scopes (chat:write, chat:write.customize)
  2. Send a message using chat.postMessage with username and icon_url parameters - observe that the message displays with the custom username and icon
  3. Send a streaming message using chat_stream with the same username and icon_url parameters - observe that the message displays with the bot's default name/icon instead

Working call (chat.postMessage):

from slack_sdk.web.async_client import AsyncWebClient
client = AsyncWebClient(token="xoxb-...")
# This works - message displays as "Claude Code" with custom icon
response = await client.chat_postMessage(
channel="C1234567890",
thread_ts="1234567890.123456",
text="Hello from Claude Code!",
username="Claude Code",
icon_url="https://claude.ai/images/claude_app_icon.png",
)

Non-working call (chat_stream):

from slack_sdk.web.async_client import AsyncWebClient
client = AsyncWebClient(token="xoxb-...")
# This does NOT work - message displays with bot's default name, ignoring overrides
streamer = await client.chat_stream(
channel="C1234567890",
thread_ts="1234567890.123456",
username="Claude Code",
icon_url="https://claude.ai/images/claude_app_icon.png",
)
await streamer.append(markdown_text="Hello from Claude Code!")
await streamer.stop()

Expected result:

When passing username and icon_url (or icon_emoji) to chat_stream, the streaming message should display with the custom username and icon, just like chat.postMessage does.

The underlying chat.postMessage.stream API should support these parameters since regular chat.postMessage does.

Actual result:

The username and icon_url parameters are silently ignored when passed to chat_stream. The message displays with the bot's default identity (the name/icon configured in the Slack app settings) instead of the custom values.

This makes it impossible to use persona overrides (showing different display names/icons for different agents in a multi-agent bot) with the streaming API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions