fix(a2a): honor PORT when serving locally - #593
Merged
Merged
Conversation
jariy17
reviewed
Jul 23, 2026
jariy17
left a comment
Contributor
There was a problem hiding this comment.
pretty good, just some edge cases to solve for
Contributor
|
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
# Conflicts: # pyproject.toml # src/bedrock_agentcore/runtime/a2a.py # tests/bedrock_agentcore/runtime/test_a2a.py # tests/integration/runtime/test_a2a_integration.py # uv.lock
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
jariy17
approved these changes
Jul 24, 2026
jariy17
added a commit
that referenced
this pull request
Aug 4, 2026
serve_a2a() resolved its port from the generic PORT environment variable (#593), but the AgentCore Runtime A2A service contract fixes the container port at 9000 (HTTP is 8080, MCP is 8000). PORT is a widespread convention and is commonly already set to another protocol's port -- notably in an image shared across an HTTP and an A2A runtime, where PORT=8080 is correct for HTTP and fatal for A2A. When PORT was set to anything other than 9000, the A2A server bound there instead. Nothing listened on 9000, the runtime frontend's proxied connection was never answered, and every invocation failed with HTTP 424 (RuntimeClientError) after a client-side read timeout. The container started cleanly and logged no error, since the process was healthy and merely listening on the wrong port. Read the protocol-scoped A2A_PORT instead, which cannot collide with another protocol's port, and warn when the resolved port is not 9000 -- that configuration cannot work in a deployed runtime, so the previous silence was the expensive part of this failure. Precedence is unchanged for explicit callers: port= argument, then A2A_PORT, then 9000. Co-authored-by: jariy17 <tjariy+jariy17@users.noreply.github.com>
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's port from the explicit argument, thenPORT, then the existing9000default.port=precedence for backwards compatibility.This is stacked on #591 because the current
mainbranch does not yet contain the A2A SDK v1serve_a2aimplementation. It enables the CLI to assign distinct ports to multiple local CodeZip A2A runtimes.Testing
pytest tests/bedrock_agentcore/runtime/test_a2a.py -q(28 passed)ruff checkandruff format --checkon changed Python files