Repository navigation
Add max_retries to AgentSkillsToolset - #74381
Merged
Merged
Conversation
vatsrahul1001
approved these changes
Oct 7, 2026
Lee-W
approved these changes
Oct 7, 2026
pydantic-ai-skills gives its tools a budget of one correction, and the toolset-level value takes precedence over the agent's retries, so a model that named two missing skill resources in a row failed the run however the agent was configured. AgentSkillsToolset now takes max_retries and passes it through, the same parameter the other toolsets in this provider expose. It is only forwarded when set, so the default budget is unchanged.
Every other toolset in this provider treats max_retries=None as the agent's tool retry budget. AgentSkillsToolset now does too: it sets each tool's budget in get_tools, resolved the same way as AirflowToolset._get_tool_max_retries, instead of forwarding the value into pydantic-ai-skills, whose toolset fixes its own budget at one correction. With the agent's default retries of one, the default behaviour is unchanged.
kaxil
force-pushed
the
skills-toolset-max-retries
branch
from
October 7, 2026 11:55
36be001 to
48d2e08
Compare
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.
Stacked on #74379. Until that merges, this diff also shows its commit; the changes here are the last two commits.
pydantic-ai-skillsgives its tools a budget of one correction, and that toolset-level value overrides the agent'sretries. So a model that named two missing skill resources in a row failed the run withUnexpectedModelBehavior: Tool 'read_skill_resource' exceeded max retries count of 1, even withagent_params={"retries": {"tools": 3}}.AgentSkillsToolsethad no way to change that.AgentSkillsToolsetnow takesmax_retrieswith the same meaning it has on the SQL, hook, DataFusion and object storage toolsets:None, the default, uses the agent's tool retry budget.It works by setting each tool's budget in
AgentSkillsToolset.get_tools, resolved the same way asAirflowToolset._get_tool_max_retries. Nothing is forwarded intopydantic-ai-skills, so the fix does not depend on how that library handles the value. With the agent's defaultretriesof one, nothing changes for existing Dags.A real-run test covers three cases:
retriesraised to 3, the run finishes. This case fails without the change.max_retries=2wins over the agent's value.The restricted Agent Skills example now sets
max_retries=3. The guide and the retry-budget section of the toolsets index describe the parameter, with both outcomes re-captured from a real run.