Open
Conversation
Adds ~130 lines of Bedrock-specific glue around the official a2a-sdk, replacing the need for a custom protocol implementation. The industry (ADK, Strands, CrewAI) has converged on the a2a-sdk, and this delegates all protocol handling to it. New exports from bedrock_agentcore.runtime: - serve_a2a(executor, agent_card=None, ...) — one-liner to start an A2A server - build_a2a_app(executor, agent_card=None, ...) — returns a Starlette app - BedrockCallContextBuilder — extracts Bedrock headers into contextvars Key features: - Optional a2a-sdk dependency: pip install "bedrock-agentcore[a2a]" - Auto-builds AgentCard from StrandsA2AExecutor when not provided - Auto-populates agent_card.url from AGENTCORE_RUNTIME_URL env var - Docker/container host detection (0.0.0.0 vs 127.0.0.1) - /ping health check endpoint with optional custom handler - Propagates session, request, token, and custom headers via contextvars Works with any framework that provides an a2a-sdk AgentExecutor: - Strands: serve_a2a(StrandsA2AExecutor(agent)) - ADK: serve_a2a(A2aAgentExecutor(runner=runner), card) - LangGraph: serve_a2a(CustomExecutor(graph), card)
80adc3e to
3bcc879
Compare
Contributor
|
Your proposal listed three components: serve_a2a, BedrockCallContextBuilder, and build_runtime_url(agent_arn, region). The third one isn’t here. Intentionally dropped, or coming in a follow-up? Customers deploying to AgentCore need to construct the runtime URL from their ARN — without this utility they’ll do it themselves (and can get the URL-encoding of the ARN wrong). |
sundargthb
reviewed
Mar 16, 2026
| status = PingStatus.HEALTHY | ||
| return JSONResponse({"status": status.value, "time_of_last_update": int(last_status_update_time)}) | ||
|
|
||
| app.routes.append(Route("/ping", _handle_ping, methods=["GET"])) |
Contributor
There was a problem hiding this comment.
Minor: if future Starlette version compiles routes eagerly in build(), will this break ? I am good if we can rely on this implementation detail.
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
serve_a2a,build_a2a_app, andBedrockCallContextBuildertobedrock_agentcore.runtimea2a-sdkpip install "bedrock-agentcore[a2a]"AgentCardfromStrandsA2AExecutorwhen not providedagent_card.urlfromAGENTCORE_RUNTIME_URLenv var on deploy0.0.0.0vs127.0.0.1/pinghealth check endpoint with Bedrock-compatible response formatBedrockAgentCoreContextcontextvarsWhy
PR #217 reimplemented A2A from scratch (~1700 lines). The industry (ADK, Strands, CrewAI) has converged on the official
a2a-sdk. This replaces that approach with minimal glue that delegates protocol handling to the SDK.Strands
Google ADK
LangGraph
Test plan
tests/bedrock_agentcore/runtime/test_a2a.pytests/integration/runtime/test_a2a_integration.pyAGENTCORE_RUNTIME_URLruff check/ruff formatclean