8000 Fix agent printing too often while thinking by wreed4 · Pull Request #1172 · PrefectHQ/marvin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix agent printing too often while thinking #1172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wreed4
Copy link
@wreed4 wreed4 commented Jun 15, 2025

This change fixes the logic in the print handler allowing thinking events to print within the same panel. Without this logic, Marvin would make a new panel if thinking events were even a millisecond apart, which happens quite frequently 😉.

@Copilot Copilot AI review requested due to automatic review settings June 15, 2025 04:37
Copy link
Contributor
@Copilot 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

This PR reduces the frequency of agent prints during thinking by coarsening the timestamp resolution used in the stable event ID.

  • Changed timestamp granularity from full ISO format to hour-level only
  • Affects how event IDs are generated to prevent repeated prints within the same hour
Comments suppressed due to low confidence (2)

src/marvin/handlers/print_handler.py:233

  • Add a comment explaining why the timestamp is truncated to the hour (e.g., to batch prints within the same hour), so future readers understand the rationale.
msg_time = event.timestamp.isoformat(timespec='hour')

src/marvin/handlers/print_handler.py:233

  • Add a unit test to verify that events within the same hour produce the same event_id and that events in different hours produce distinct IDs.
msg_time = event.timestamp.isoformat(timespec='hour')

Copy link
Collaborator
@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

thanks! @wreed4

@zzstoatzz
Copy link
Collaborator

actually @wreed4 can you share what model / setup you have here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0