Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Sep 17, 2025

Summary

This PR adds the chat_{appendStream|startStream|stopStream} methods to slack_sdk 👾 ✨

Testing

response = client.chat_startStream(channel="C0123456789")
client.chat_appendStream(channel="C0123456789", ts=response["ts"], markdown_text="...")
client.chat_stopStream(channel="C0123456789", ts=response["ts"])

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

@zimeg zimeg requested a review from mwbrooks September 17, 2025 17:00
@zimeg zimeg self-assigned this Sep 17, 2025
@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor web-client Version: 3x labels Sep 17, 2025
@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.94%. Comparing base (ed1893d) to head (2112b8d).
⚠️ Report is 1 commits behind head on ai-apps.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           ai-apps    #1745      +/-   ##
===========================================
+ Coverage    84.90%   84.94%   +0.04%     
===========================================
  Files          113      113              
  Lines        12886    12916      +30     
===========================================
+ Hits         10941    10972      +31     
+ Misses        1945     1944       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

This is looking good 💯

We should probably include these changes in tests/slack_sdk_async/web/test_web_client_coverage.py

Since these endpoints seems fairly straight forward it may be a good idea to add integration tests for them in integration_tests/web

# NOTE: intentionally using json over params for API methods using blocks/attachments
return self.api_call("chat.update", json=kwargs)

def chat_scheduledMessages_list(
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems weird that git is detecting this as a deletion rather then a move in slack_sdk/web/client.py

"unfurl_media": unfurl_media,
}
)
kwargs = _remove_none_values(kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we only need this when we pass the kwargs is passed though json= to api_call 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

@WilliamBergamin Thanks for catching this! I think we can prefer params in 5ce303d which works well in testing, unless you have a preference to using json which ought work too?

}
)
_parse_web_class_objects(kwargs)
kwargs = _remove_none_values(kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Praise 🙏

Copy link
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.

🙏🏻 Looking solid @zimeg!

🧪 I'm going to build this package and test locally, but I just wanted to drop a comment that the APIs look accurate from my perspective.

Comment on lines +2903 to +2904
blocks: Optional[Union[str, Sequence[Union[Dict, Block]]]] = None,
metadata: Optional[Union[Dict, Metadata]] = None,
Copy link
Member

Choose a reason for hiding this comment

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

👌🏻 Great catch on setting these as optional.

Copy link
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.

✅ Excellent work @zimeg! 🚀 Rockets away!

@zimeg
Copy link
Member Author

zimeg commented Sep 19, 2025

@WilliamBergamin @mwbrooks Kind appreciation for the reviews of implementation and confirmation of arguments in these changes. I will merge it now for a prerelease we can experiment more with.

@zimeg zimeg merged commit f60e37c into ai-apps Sep 19, 2025
12 checks passed
@zimeg zimeg deleted the zimeg-feat-web-api-chat-stream branch September 19, 2025 03:50
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 semver:minor Version: 3x web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants