-
Notifications
You must be signed in to change notification settings - Fork 387
test tool limiting #1196
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
test tool limiting #1196
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -64,6 +64,7 @@ def prefect_wrapped_function( | |||||||
| decorator: Callable[..., Callable[..., T]] = task, | ||||||||
| tags: set[str] | None = None, | ||||||||
| settings: dict[str, Any] | None = None, | ||||||||
| max_tool_calls: int = 15, # Default limit per agent run | ||||||||
|
||||||||
| max_tool_calls: int = 15, # Default limit per agent run | |
| max_tool_calls: int = 50, # Default limit per agent run (matches settings file) |
Outdated
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is returning a string when the expected return type is T. This will cause a type mismatch and potential runtime errors since the calling code expects the original function's return type, not a string message.
| return "I've reached my tool use limit for this response. Please ask a follow-up question if you need more information." | |
| # Raise an exception instead of returning a string to preserve type safety | |
| raise ToolUseLimitExceeded("I've reached my tool use limit for this response. Please ask a follow-up question if you need more information.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code assumes
admin_slack_user_idis optional, but the field definition doesn't show it as Optional. If it's a required field, this check will never be True. If it should be optional, the field type should beOptional[str]orstr | None.