Backport pydantic-ai bridge submodule onto 0.6 line#56
Merged
dsfaccini merged 2 commits intoMay 15, 2026
Conversation
Targets the pre-A2A-v1-spec schema (commit a6d6cf0, last commit before datalayer#46). Imports + accesses the discriminated TextPart/FilePart/DataPart shape that the released v0.6.0 ships. Goal: ship a 0.6.1 maintenance release with this bridge so Pydantic AI 1.x users have a migration target while v0.7 (with the v1-spec rewrite) is still pre-release. Includes the same fixes as the main-targeting bridge PR: - ruff format pass + import sort (I001) - pydantic-ai optional dep gated to python_version >= '3.10' - README 'Using Pydantic AI' section rewritten for the new bridge - pydantic-ai private-import fixes (AgentDepsT from _run_context, OutputDataT from output) - @asynccontextmanager AsyncIterator -> AsyncGenerator (reportDeprecated) Companion PR on Pydantic AI side: pydantic/pydantic-ai#5426
My ~/.config/uv/uv.toml sets a supply-chain cooldown via `exclude-newer`, which gets baked into every uv.lock as an `[options]` block on regeneration. Doesn't belong in an upstream lockfile — strip it here.
dsfaccini
added a commit
to dsfaccini/pydantic-ai
that referenced
this pull request
May 15, 2026
The bridge port landed in fasta2a v0.6.1 (datalayer/fasta2a#56), released to PyPI. Updated the deprecation surfaces to give users a concrete migration path: - Bumped `pydantic-ai-slim[a2a]` floor to `fasta2a>=0.6.1` - Updated the `Agent.to_a2a()` and `agent_to_a2a` deprecation messages to recommend `pip install 'fasta2a[pydantic-ai]>=0.6.1'` and `from fasta2a.pydantic_ai import agent_to_a2a` - Rewrote `docs/a2a.md` to show the new bridge as the recommended path; `docs/install.md` annotates the `a2a` extra as deprecated - Updated the orchestration-and-integrations skill snippet to import from the bridge - Tightened `tests/v2/test_a2a_deprecation.py` regex to match the new warning text
This was referenced May 15, 2026
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.
Summary
Adds the
fasta2a.pydantic_aibridge (agent_to_a2a,AgentWorker,worker_lifespan) on top of the pre-A2A-v1-spec line so we can cut a0.6.1maintenance release. This gives Pydantic AI 1.x users a real migration target forAgent.to_a2a()before the v2 cut.The bridge is a near-1:1 port of
pydantic_ai._a2aand targets the discriminatedTextPart/FilePart/DataPartschema that v0.6.0 ships, so no schema changes are needed here.Companion change
Pydantic AI side: pydantic/pydantic-ai#5426 (deprecates
Agent.to_a2a()with a warning pointing at this package).Why a 0.6 backport
The A2A v1 spec rewrite landed on
main(#46–#51) has not yet been validated against a real A2A client, so shipping a 0.6.1 maintenance release with the bridge on the pre-v1-spec base is the conservative path: Pydantic AI 1.x users get a migration target now whilemaincontinues to bake.What's in this PR
fasta2a/pydantic_ai/__init__.pyre-exportsfasta2a/pydantic_ai/_bridge.py(~240 LOC port ofpydantic_ai._a2a)pyproject.toml: new[pydantic-ai]optional extra pinned topydantic-ai-slim>=1.92; python_version >= '3.10'README.md: 'Using Pydantic AI' section rewritten for the new bridge import pathuv.lockregeneratedVerification
Run on commit
43de2e9locally against a Pydantic AI worktree at #5426's HEAD:scripts/check— clean: ruff format/check, pyright 0/0/0, check-sdist, lock validscripts/test— 5/5 passuv build— producesfasta2a-0.6.1.dev3+43de2e9-py3-none-any.whlcleanlyfrom fasta2a.pydantic_ai import agent_to_a2aworksagent_to_a2a(Agent(TestModel()))returns aFastA2AASGI app/.well-known/agent-card.jsontasks/getfor unknown task returns-32001 TaskNotFoundErrorAgent.to_a2a()back-compat path still works and emits a deprecation warning pointing atdatalayer/fasta2atests/test_a2a.pyin the deprecation branch: 11/11 pass with this wheel installedRelease plan
After merge, tag this branch's HEAD as
v0.6.1and push;publish.ymltriggers on tag and publishes to PyPI via trusted publisher (the same path used for v0.6.0).