Skip to content

Migrate A2A runtime integration to a2a-sdk v1.x #509

@jariy17

Description

@jariy17

Summary

Migrate the A2A runtime integration (src/bedrock_agentcore/runtime/a2a.py) to support a2a-sdk v1.x. The SDK currently only works with a2a-sdk 0.3.x; #438 reported that v1.0+ breaks at import time, and PR (cap fix) pins a2a-sdk[http-server]>=0.3,<1.0 as a stopgap. This issue tracks lifting that cap by porting to the new v1.x server API.

Background

a2a-sdk v1.0.0 (March 2026) redesigned the server API. Verified against a2a-sdk 1.1.0:

What a2a.py uses today (0.3.x) Status in v1.x
a2a.server.apps (module) ❌ removed — replaced by a2a.server.routes
a2a.server.apps.A2AStarletteApplication ❌ removed — app model replaced (create_jsonrpc_routes, add_a2a_routes_to_fastapi)
a2a.server.apps.CallContextBuilder ❌ removed — replaced by a2a.server.routes.ServerCallContextBuilder / DefaultServerCallContextBuilder
a2a.types.DataPart ❌ moved — now under a2a.compat.v0_3.types
a2a.server.request_handlers.DefaultRequestHandler ✅ still present
a2a.server.tasks.InMemoryTaskStore ✅ still present
a2a.server.context.ServerCallContext ✅ still present
a2a.types.AgentCard / AgentCapabilities / AgentSkill ✅ still present

Scope of work

  • Rewrite build_a2a_app() to construct the app via the v1.x a2a.server.routes API instead of A2AStarletteApplication.add_routes_to_app().
  • Replace BedrockCallContextBuilder's base (CallContextBuilder) with the v1.x ServerCallContextBuilder interface, preserving the Bedrock header/baggage extraction behavior.
  • Audit all a2a.* imports in a2a.py against v1.x and update moved symbols.
  • Decide on the support window: either move the floor to >=1.0 (drop 0.3.x), or support both 0.3.x and 1.x behind a version check. Recommendation to be settled in the PR.
  • Update the a2a extra pin in pyproject.toml accordingly and refresh uv.lock.
  • Update src/bedrock_agentcore/runtime/a2a.py docstrings/README A2A examples.
  • Add/adjust tests to cover the v1.x code path.

Acceptance criteria

  • pip install "bedrock-agentcore[a2a]" with a2a-sdk v1.x installed starts the server via serve_a2a without ModuleNotFoundError.
  • A2A server starts on port 9000 and serves the agent card + /ping.
  • Tests pass against the supported a2a-sdk version(s).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions