Skip to content

Port pydantic-ai v1.103.0: PreparedToolset nullish-prepare warning + version parity update#101

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/port-pydantic-ai-v1-103-0-changes
Draft

Port pydantic-ai v1.103.0: PreparedToolset nullish-prepare warning + version parity update#101
Copilot wants to merge 2 commits into
mainfrom
copilot/port-pydantic-ai-v1-103-0-changes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

This PR advances the tracked upstream parity from pydantic-ai v1.87.0 to v1.103.0 for the parts relevant to the SDK. From this release span, the applicable runtime change was toolset prepare-callback handling when None/undefined is returned.

  • Runtime behavior: PreparedToolset nullish prepare handling

    • Updated PreparedToolset.tools() to handle prepare returning null/undefined.
    • New behavior: emit a warning and fall back to the inner tool list, instead of propagating a nullish result.
  • Regression coverage

    • Added a focused test that verifies:
      • warning emission on nullish prepare return
      • fallback tool exposure remains intact for the turn
  • Parity/docs/version tracking

    • Bumped .github/pydantic-ai-version.txt to 1.103.0.
    • Updated packages/sdk/docs/reference/features.mdx to document the newly ported prepare-callback warning behavior under Toolsets.
async tools(ctx: RunContext<TDeps>): Promise<ToolDefinition<TDeps>[]> {
  const innerTools = await this._inner.tools(ctx);
  const preparedTools = await this._prepare(ctx, innerTools);

  if (preparedTools === null || preparedTools === undefined) {
    console.warn(
      "PreparedToolset.prepare returned null/undefined; falling back to inner tools.",
    );
    return innerTools;
  }

  return preparedTools;
}

Copilot AI linked an issue May 27, 2026 that may be closed by this pull request
11 tasks
Copilot AI changed the title [WIP] Update pydantic-ai to version 1.103.0 Port pydantic-ai v1.103.0: PreparedToolset nullish-prepare warning + version parity update May 27, 2026
Copilot finished work on behalf of a7ul May 27, 2026 10:37
Copilot AI requested a review from a7ul May 27, 2026 10:37
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.

chore: port pydantic-ai v1.103.0 changes

2 participants