Skip to content

Fix: VercelAIAdapter now accepts providerExecuted / title on dynamic-tool message parts#5474

Merged
DouweM merged 4 commits into
pydantic:mainfrom
he-yufeng:fix/vercel-dynamic-tool-fields
May 22, 2026
Merged

Fix: VercelAIAdapter now accepts providerExecuted / title on dynamic-tool message parts#5474
DouweM merged 4 commits into
pydantic:mainfrom
he-yufeng:fix/vercel-dynamic-tool-fields

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • accept title and providerExecuted on dynamic-tool request parts
  • keep parity with Vercel AI SDK dynamic tool parent fields
  • add coverage across all dynamic-tool states

Fixes #5359.

To verify

  • uv run pytest tests/test_vercel_ai.py -q -k "dynamic_tool_parent_fields" --basetemp .tmp/pytest-fast
  • uv run pytest tests/test_vercel_ai.py -q --basetemp .tmp/pytest
  • uv run python -m py_compile pydantic_ai_slim\pydantic_ai\ui\vercel_ai\request_types.py tests\test_vercel_ai.py
  • uv run ruff format --check pydantic_ai_slim\pydantic_ai\ui\vercel_ai\request_types.py tests\test_vercel_ai.py
  • uv run ruff check pydantic_ai_slim\pydantic_ai\ui\vercel_ai\request_types.py tests\test_vercel_ai.py
  • uv run pyright pydantic_ai_slim\pydantic_ai\ui\vercel_ai\request_types.py tests\test_vercel_ai.py

@github-actions github-actions Bot added size: S Small PR (≤100 weighted lines) bug Report that something isn't working, or PR implementing a fix labels May 15, 2026
@github-actions github-actions Bot added size: M Medium PR (101-500 weighted lines) and removed size: S Small PR (≤100 weighted lines) labels May 22, 2026
@dsfaccini

dsfaccini commented May 22, 2026

Copy link
Copy Markdown
Collaborator

David's AICA here: I updated this branch with the follow-up fixes we discussed.

What changed beyond the original parse fix:

  • Rebased/merged the branch onto current main so it is testing against the latest Vercel adapter code.
  • Added title to static tool-* request parts too, since the AI SDK parent ToolUIPart includes it, not only DynamicToolUIPart.
  • Preserved the semantics of providerExecuted on dynamic-tool parts when loading UI messages: dynamic provider-executed tool parts now become NativeToolCallPart / NativeToolReturnPart, matching pyai native/provider-executed tool history rather than being treated as ordinary function tools.
  • Consolidated the request validation coverage so the same test covers static and dynamic tool parent fields across all tool states.
  • Added adapter coverage for dynamic provider-executed output-available, output-error, and output-denied parts.

Verification run locally:

  • uv run pytest tests/test_vercel_ai.py -q -k 'tool_parent_fields or provider_executed_dynamic_tool' --basetemp .tmp/pytest-pr5474-user

Result: 15 passed.

@DouweM DouweM changed the title fix: accept dynamic tool parent fields Fix: VercelAIAdapter now accepts providerExecuted / title on dynamic-tool message parts May 22, 2026
@DouweM

DouweM commented May 22, 2026

Copy link
Copy Markdown
Collaborator

@he-yufeng Thank you! Keep up the good work at Moonshot :)

@DouweM DouweM merged commit 35ab013 into pydantic:main May 22, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Report that something isn't working, or PR implementing a fix size: M Medium PR (101-500 weighted lines) vercel-ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VercelAIAdapter rejects spec-compliant providerExecuted / title on dynamic-tool message parts

3 participants