feat: use set_suggested_prompts helper with agent_view #1549#94
Draft
mwbrooks wants to merge 1 commit into
Draft
feat: use set_suggested_prompts helper with agent_view #1549#94mwbrooks wants to merge 1 commit into
mwbrooks wants to merge 1 commit into
Conversation
Vendors slack-bolt built from PR #1549 (commit 812f7c3) and migrates all three sample apps from raw client.assistant_threads_setSuggestedPrompts calls to the context.set_suggested_prompts helper. The PR fixes two problems: (1) the helper's constructor required thread_ts, which is None for top-level DMs under agent_view, and (2) the middleware did not inject the helper for app_home_opened events. Both fixes are exercised here — the samples now call the helper from app_home_opened when tab == "messages". Do not merge until PR #1549 is released to PyPI.
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
This PR currently ships a vendored bolt wheel. We must remove the vendored bolt (run /unvendor-bolt or the equivalent steps) once PR #1549 is merged and released to PyPI, then bump slack-bolt in all three requirements.txt files to the released version. Do not merge until then.
Summary
This pull request migrates all three sample apps from the raw
client.assistant_threads_setSuggestedPrompts(...)Web API call to the Boltcontext.set_suggested_promptshelper, to verify the fixes in slackapi/bolt-python#1549.Changes:
client.assistant_threads_setSuggestedPrompts(...)withawait context.set_suggested_prompts(...)(sync equivalent foropenai-agents-sdkandpydantic-ai) in eachlisteners/events/app_home_opened.pytests/test_app_home_opened.pyin each sample to mock the injected helper on the fake context instead of the raw client methodNotes
Test Plan
pytestpasses in all three samples (7/7 each)ruff check .andruff format --check .clean in all three samplespython3 app.py, open a DM, confirm the three suggested prompts render with title "How can I help you today?"