You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
DRFMCPToolset(max_retries=...) — each tool's retry budget: how many times a ModelRetry (malformed arguments, a service-raised validation error) is fed
back to the model before the run aborts. Defaults to 1, matching
pydantic-ai's own function-tool default.
Changed (breaking)
DrfMcpToolset is renamed DRFMCPToolset, matching the capitalized
acronyms of its sibling classes (MCPServer, AGUIServer) and PEP 8's
CapWords convention. The class is built internally by the view from the DRF_MCP_SERVER setting, so only code importing it directly from django_ag_ui.integrations.drf_mcp needs the one-line rename; no alias is
kept.
Changed
DRFMCPToolset now subclasses pydantic_ai.toolsets.AbstractToolset
directly (the documented extension point) instead of ExternalToolset,
building its tool definitions kind="function" from the start. Previously
it inherited from a base class that models the opposite of in-process
execution (external tools are deferred to the client) and re-stamped every
tool definition back to kind="function" per run — the version-fragile seam
behind the historically tight <2 pydantic-ai pin. Public API and tool
behaviour are otherwise unchanged.
Fixed
A bridged tool's ModelRetry (malformed arguments, a service-raised
validation error) now actually reaches the model to self-correct, as
documented. ExternalToolset pinned every tool's retry budget to 0, so in
a real agent run the first ModelRetry aborted the run with UnexpectedModelBehavior instead of retrying. Pinned by a full agent-run
integration test.