fix(a2a): honor PORT when serving locally#593
Open
notgitika wants to merge 2 commits into
Open
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
| from starlette.responses import JSONResponse | ||
| from starlette.routing import Route | ||
|
|
||
| runtime_url = os.environ.get(AGENTCORE_RUNTIME_URL_ENV, "http://localhost:9000/") |
Contributor
There was a problem hiding this comment.
PORT is used for uvicorn, but the generated agent card still defaults to localhost:9000. with PORT=9001, the server binds to 9001 while the card advertises 9000. can we pass the resolved port into the card URL and add a test for it?
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