Skip to content

Conversation

zimeg
Copy link
Member

@zimeg zimeg commented Sep 24, 2025

Summary

This PR accepts assistant.thread.setStatus method arguments from the Assistant class to support additional arguments.

Preview

The following is now supported when using the Assistant class:

@assistant.user_message
def respond_in_assistant_thread(
    client: WebClient,
    context: BoltContext,
    logger: logging.Logger,
    payload: dict,
    say: Say,
    set_status: SetStatus,
):
    loading_messages = [
        "Teaching the hamsters to type faster…",
        "Untangling the internet cables…",
        "Consulting the office goldfish…",
        "Polishing up the response just for you…",
        "Convincing the AI to stop overthinking…",
    ]

    set_status(
        status="Bolt is typing",
        loading_messages=loading_messages,
    )

Testing

Use the changes of this PR and this sample app: slack-samples/bolt-python-assistant-template#12 🏁

  • Planning to follow up soon with unit tests!

Notes

Hoping to align a similar implementation for bolt-js too: slackapi/bolt-js#2660 👾

Category

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • 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 ./scripts/install_all_and_run_tests.sh after making the changes.

@zimeg zimeg requested review from mwbrooks and srtaalej September 24, 2025 06:21
@zimeg zimeg self-assigned this Sep 24, 2025
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (ai-apps@973af99). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             ai-apps    #1371   +/-   ##
==========================================
  Coverage           ?   91.00%           
==========================================
  Files              ?      222           
  Lines              ?     7514           
  Branches           ?        0           
==========================================
  Hits               ?     6838           
  Misses             ?      676           
  Partials           ?        0           

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

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'll test this out momentarily.

❓ Are you still planning to add some unit tests to this?

thread_ts=self.thread_ts,
status=status,
loading_messages=loading_messages,
**kwargs,
Copy link
Member

Choose a reason for hiding this comment

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

priaise: The **kwargs is a nice touch to add some future proofing for additional arguments. 🆗

@zimeg
Copy link
Member Author

zimeg commented Sep 24, 2025

@mwbrooks I was hoping to've found tests sooner! Thank you for reviewing this so fast though 🎁 ✨

Let's mark this as a draft for now, but I will aim for soon follow up.

@zimeg zimeg marked this pull request as draft September 24, 2025 19:23
@zimeg zimeg marked this pull request as ready for review September 26, 2025 00:49
@zimeg zimeg requested a review from mwbrooks September 26, 2025 00:49
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.

✅ Beauty!

🧪 I've tested it with the sample app branch and things look good!

📚 Thanks for generating the docs! 🙇🏻

@zimeg
Copy link
Member Author

zimeg commented Sep 29, 2025

@mwbrooks Thank you! Let's merge this for upcoming releases in more testing and similar 🚢 💨

@zimeg zimeg merged commit c8f2d6e into ai-apps Sep 29, 2025
14 checks passed
@zimeg zimeg deleted the zimeg-feat-assistant-set-status-arguments branch September 29, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants