- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.3k
Refine retry logic for parallel tool calling #2317
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
Conversation
Move retry count management from _call_tool to for_run_step method. Build new retry dict with only failed_calls keys inheriting ctx.retries values + 1. This ensures retry counts are scoped per tool name per run step rather than per individual failure. Co-authored-by: Douwe Maan <DouweM@users.noreply.github.com>
| @claude Rename  | 
| Claude finished @DouweM's task —— View job Todo List
 ✅ Changes completed successfully!Variable renames in  
 Added comprehensive tests in  
 Note: I wasn't able to run  The changes have been committed and pushed to the PR branch. | 
- Rename failed_calls field to failed_tools for better clarity - Rename updated_retries variable to retries for consistency - Add comprehensive tests for retry logic including: - Test for basic retry logic with failed_tools and for_run_step - Test for multiple failed tools in same run step - Verify retry counts are properly scoped per tool name per run step Co-authored-by: Douwe Maan <DouweM@users.noreply.github.com>
| @claude You're now able to run  | 
| Claude finished @DouweM's task —— View job Todo List
 ❌ Unable to run validation commandsI attempted to run  The environment is missing required tools: 
 ✅ Previous changes completed successfullyThe core task was already completed in the previous interaction: Variable renames in  
 Added comprehensive tests in  
 The changes have been committed and pushed to the PR branch. The code validation will need to be run in an environment with the required system dependencies installed. | 
| Docs Preview
 | 
# Conflicts: # pydantic_ai_slim/pydantic_ai/_tool_manager.py
Fixes #2311
Refines the retry logic to move retry count management from
_call_tooltofor_run_stepmethod. This ensures retry counts are scoped per tool name per run step rather than per individual failure.Changes
failed_calls: set[str]field to track tools that failed in current run step_call_toolto add failed tool names tofailed_callsinstead of incrementing retry countfor_run_stepto build new retry dict with only failed tool names and their updated counts_call_toolsince it's now handled infor_run_stepGenerated with Claude Code