Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds real-time progress updates to Slack bot flows and adjusts search tooling and prompts.
- Introduces a
ContextVarand extends the task wrapper to append progress messages during tool execution. - Adds
ProgressMessageclass andcreate_progress_messagehelper for posting/updating messages in Slack. - Updates
run_agentandhandle_messageto initialize, set, update, and reset progress context. - Renames
search_controlflow_docstosearch_marvin_docsand updates research agent tooling. - Refines system prompt emphasis on character usage limits.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| examples/slackbot/src/slackbot/wrap.py | Introduce _progress_message ContextVar and enhance prefect_wrapped_function to append per-tool progress. |
| examples/slackbot/src/slackbot/slack.py | Add ProgressMessage class and create_progress_message for creating/updating Slack progress messages. |
| examples/slackbot/src/slackbot/search.py | Rename search_controlflow_docs to search_marvin_docs and update its namespace and docstring. |
| examples/slackbot/src/slackbot/research_agent.py | Swap out old controlflow search tool, adjust docstring guidance in research agent. |
| examples/slackbot/src/slackbot/core.py | Modify DEFAULT_SYSTEM_PROMPT to enforce stricter limits on character usage. |
| examples/slackbot/src/slackbot/api.py | Update run_agent signature to accept channel_id/thread_ts, integrate progress creation and context var. |
Comments suppressed due to low confidence (5)
examples/slackbot/src/slackbot/research_agent.py:65
- The docstring list formatting was changed here from a numbered item to plain text, breaking consistency; consider restoring the list bullet/number format.
You don't need to use all the tools all the time, but use relevant ones repeatedly if needed.
examples/slackbot/src/slackbot/core.py:34
- [nitpick] The all-caps phrase in the system prompt is stylistically inconsistent and may impact readability; consider using sentence case or bold markup instead.
Provide concise and SUBTLY (only once in a while, OVERDOING THE CHARACTER IS UNACCEPTABLE) character-inspired and HELPFUL answers...
examples/slackbot/src/slackbot/slack.py:305
- No tests were added for the ProgressMessage start/update/append methods; consider adding test coverage to validate progress messaging behavior.
async def start(self, initial_text: str = "🔄 Working...") -> "ProgressMessage":
examples/slackbot/src/slackbot/wrap.py:65
- [nitpick] Using setstr may confuse readers; consider using the more conventional set() for initializing tags.
tags = tags or set[str]()
examples/slackbot/src/slackbot/api.py:34
- Importing and using the private variable _progress_message couples to internal implementation; consider exposing a public API or refactoring to avoid accessing a private var.
from slackbot.wrap import WatchToolCalls, _progress_message
|
|
||
| T = TypeVar("T") | ||
|
|
||
| _progress_message: ContextVar[Any] = ContextVar("progress_message", default=None) |
There was a problem hiding this comment.
Consider typing _progress_message as ContextVar[ProgressMessage | None] instead of ContextVar[Any] to improve type safety.
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.
No description provided.