Skip to content

Conversation

@zzstoatzz
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 8, 2025 19:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds real-time progress updates to Slack bot flows and adjusts search tooling and prompts.

  • Introduces a ContextVar and extends the task wrapper to append progress messages during tool execution.
  • Adds ProgressMessage class and create_progress_message helper for posting/updating messages in Slack.
  • Updates run_agent and handle_message to initialize, set, update, and reset progress context.
  • Renames search_controlflow_docs to search_marvin_docs and 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)
Copy link

Copilot AI Jun 8, 2025

Choose a reason for hiding this comment

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

Consider typing _progress_message as ContextVar[ProgressMessage | None] instead of ContextVar[Any] to improve type safety.

Copilot uses AI. Check for mistakes.
@zzstoatzz zzstoatzz merged commit 72cc426 into main Jun 8, 2025
3 checks passed
@zzstoatzz zzstoatzz deleted the thinking branch June 8, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants