Repository navigation
fix(dev): honor custom ports for MCP and A2A - #2620
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
The core change is correct: commandForRuntime now mirrors the existing FASTMCP_PORT behavior for A2A, the template reads FASTMCP_PORT with a safe 8000 default, and the serve_a2a docs claim checks out — bedrock_agentcore.runtime.a2a.serve_a2a does fall back to int(os.environ.get("A2A_PORT", A2A_CONTRACT_PORT)) when port isn't passed. Test coverage via the parametrized MCP/A2A/AGUI case is a nice touch. The container runner correctly doesn't need the same treatment because the container always listens on the contract port internally and port‑remaps at the Docker boundary.
A couple of small consistency gaps you may want to clean up in this PR (not blocking — runtime behavior is still correct because the explicit assignment in codezip.ts wins over any user-provided value):
src/handlers/project/dev/environment.ts:5—RESERVED_ENV_KEYSlistsFASTMCP_PORTbut notA2A_PORT. For symmetry, consider addingA2A_PORTso user.env.localentries are filtered the same way.src/assets/templates/shared/env.local.template:3— the comment mentionsFASTMCP_PORTas CLI-owned but notA2A_PORT. Worth a one-word addition so A2A users understand the same rule applies.
No telemetry concerns (this is a wiring fix, not a new feature) and no excessive-mocking concerns in the added tests.
|
Claude Security Review: no high-confidence findings. (run) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2620 +/- ##
=========================================
Coverage 96.61% 96.61%
=========================================
Files 702 702
Lines 58344 58347 +3
=========================================
+ Hits 56369 56373 +4
+ Misses 1975 1974 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
A2A_PORTfromagentcore devfor A2A CodeZip runtimesFASTMCP_PORTContext
This follows up on #2619 and the failures in run
https://github.com/aws/agentcore-cli/actions/runs/39305293613.
The Python 3.14 pin from #2619 is active and fixed the Python 3.15 dependency
failures. The remaining deterministic failures came from the distinct ports
introduced for the template E2Es:
serve_a2a's default port 9000agentcore devwaited on the requested 1808x ports and timed outThe TypeScript template failures in that run were a separate transient npm
publication-propagation error for
@aws-sdk/credential-provider-http@3.972.77; the tarball is now available.Testing
bun testbun run typecheckbun run lint:checkbun run format:checkbun run build