Skip to content

feat(web-api): add authorship arguments to assistant threads and chat stream#2455

Merged
zimeg merged 8 commits intomainfrom
zimeg-feat-web-api-agent-id
May 4, 2026
Merged

feat(web-api): add authorship arguments to assistant threads and chat stream#2455
zimeg merged 8 commits intomainfrom
zimeg-feat-web-api-agent-id

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented Dec 17, 2025

Summary

This PR adds the "authorship" arguments - icon_emoji, icon_url, and username - to the following methods:

Reviewers

Please feel free to experiment with the following code example:

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

await client.assistant.threads.setStatus({
  channel_id: "C018QLSQ38A",
  thread_ts: "1765934795.222209",
  status: "dancing...",
  username: "Charlie Brown",
  icon_emoji: "maple_leaf",
});

await sleep(4000);

const response = await client.chat.startStream({
  channel: "C018QLSQ38A",
  thread_ts: "1765934795.222209",
  recipient_team_id: "T07L2FPUY",
  recipient_user_id: "U0187GKV2US",
  username: "Charlie Brown",
  icon_emoji: "maple_leaf",
});

await sleep(2000);

await client.chat.appendStream({
  channel: "C018QLSQ38A",
  ts: response.ts,
  markdown_text: "Dancing with snoopy dog.",
});

await sleep(2000);

await client.chat.stopStream({
  channel: "C018QLSQ38A",
  ts: response.ts,
});

Requirements

@zimeg zimeg self-assigned this Dec 17, 2025
@zimeg zimeg requested a review from a team as a code owner December 17, 2025 01:54
@zimeg zimeg added enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` labels Dec 17, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.41%. Comparing base (62c5a3f) to head (b8f5c2e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2455   +/-   ##
=======================================
  Coverage   87.41%   87.41%           
=======================================
  Files          62       62           
  Lines       10251    10251           
  Branches      415      415           
=======================================
  Hits         8961     8961           
  Misses       1269     1269           
  Partials       21       21           
Flag Coverage Δ
cli-hooks 87.41% <ø> (ø)
cli-test 87.41% <ø> (ø)
logger 87.41% <ø> (ø)
oauth 87.41% <ø> (ø)
socket-mode 87.41% <ø> (ø)
web-api 87.41% <ø> (ø)
webhook 87.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Dec 17, 2025

🏷️ note: Marking this as draft while server side changes are being made!

@zimeg zimeg marked this pull request as draft December 17, 2025 19:26
@zimeg zimeg removed the request for review from a team March 24, 2026 16:35
zimeg added 2 commits April 27, 2026 12:13
# Conflicts:
#	packages/web-api/src/types/request/chat.ts
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

🦋 Changeset detected

Latest commit: b8f5c2e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/web-api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📣 A few links to reference for kind reviewers!

Comment on lines +13 to +27
/**
* @description Emoji to use as the icon for this message. Overrides `icon_url`.
* @example :chart_with_upwards_trend:
*/
icon_emoji?: string;
/**
* @description Image URL to use as the icon for this message.
* @example http://lorempixel.com/48/48
*/
icon_url?: string;
/**
* @description The bot's username to display.
* @example My Bot
*/
username?: string;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +263 to +277
/**
* @description Emoji to use as the icon for this message. Overrides `icon_url`.
* @example :chart_with_upwards_trend:
*/
icon_emoji?: string;
/**
* @description Image URL to use as the icon for this message.
* @example http://lorempixel.com/48/48
*/
icon_url?: string;
/**
* @description The bot's username to display.
* @example My Bot
*/
username?: string;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zimeg zimeg added this to the web-api@next milestone Apr 27, 2026
@zimeg zimeg marked this pull request as ready for review April 27, 2026 19:46
Copy link
Copy Markdown
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Looks good to me @zimeg! Thanks for putting this PR together.

📝 I've added a small suggestion. I'm holding off on the approval since auto-merge is enabled. Once we decide whether to take or leave the suggestion, then I can toss a ✅ here!

Comment thread .changeset/rare-boats-brake.md Outdated
icon_emoji?: string;
/**
* @description Image URL to use as the icon for this message.
* @example http://lorempixel.com/48/48
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This URL seems to be down, but that's not a big deal.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwbrooks This might be a hosting issue but let's keep it to match reference 📚

Co-authored-by: Michael Brooks <mbrooks@slack-corp.com>
@zimeg zimeg requested a review from mwbrooks April 30, 2026 19:34
@srtaalej srtaalej self-requested a review May 4, 2026 19:25
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great and is working well for me ⭐ ⭐ ⭐

@zimeg zimeg merged commit 4b6fe3a into main May 4, 2026
32 of 36 checks passed
@zimeg zimeg deleted the zimeg-feat-web-api-agent-id branch May 4, 2026 19:26
@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented May 4, 2026

@mwbrooks @srtaalej Both reviews are so appreciated! Thanks for getting this to a release 🏁

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

Labels

enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add username and icon_url support to chatStream API

3 participants