Add a server-side override for the A2A Agent Card URL#1673
Add a server-side override for the A2A Agent Card URL#1673rapids-bot[bot] merged 2 commits intoNVIDIA:release/1.5from
Conversation
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
WalkthroughThe PR adds an optional Changes
Sequence Diagram(s)sequenceDiagram
participant K8s as Kubernetes Init
participant Server as A2A Server
participant AgentCard as Agent Card
participant Client as Client
K8s->>Server: inject NAT_PUBLIC_BASE_URL / env config
Server->>Server: read config.public_base_url or env
Server->>Server: _resolve_agent_url() (normalize trailing slash)
Server->>AgentCard: generate Agent Card with resolved URL
Client->>AgentCard: fetch Agent Card (uses public URL)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/ok to test b022e93 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/source/run-workflows/a2a-server.md`:
- Around line 117-120: Update the docs example to use the repository's required
NAT_ prefix by renaming PUBLIC_BASE_URL to NAT_PUBLIC_BASE_URL everywhere in
this section (the example key public_base_url and the explanatory sentence that
instructs to provide the variable at runtime). Ensure the text instructs users
to supply NAT_PUBLIC_BASE_URL via your deployment tooling (Helm values or
environment injection) and keep the variable name consistent across the snippet
and prose.
In
`@packages/nvidia_nat_a2a/src/nat/plugins/a2a/server/front_end_plugin_worker.py`:
- Around line 227-232: The fallback URL construction in _resolve_agent_url can
produce invalid URLs for IPv6 hosts (e.g., ::1); update the fallback branch in
_resolve_agent_url to detect IPv6 host literals (e.g., using Python's ipaddress
module or by checking for ':' in config.host) and wrap the host in square
brackets before appending the port so the returned URL is valid (use config.host
-> maybe wrap as f"[{config.host}]" when needed) while keeping existing behavior
for IPv4/hostname and preserving trailing slash.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/source/run-workflows/a2a-server.mdpackages/nvidia_nat_a2a/src/nat/plugins/a2a/server/front_end_config.pypackages/nvidia_nat_a2a/src/nat/plugins/a2a/server/front_end_plugin_worker.pypackages/nvidia_nat_a2a/tests/server/test_agent_card_generation.py
packages/nvidia_nat_a2a/src/nat/plugins/a2a/server/front_end_plugin_worker.py
Show resolved
Hide resolved
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
|
/ok to test 823cb08 |
|
/merge |
Closes NVIDIA#1501 This PR adds a server-side override for the A2A Agent Card URL so deployments behind Kubernetes ingress/proxies can publish the correct external endpoint. Sample Usage: ``` nat a2a serve --config_file examples/getting_start ed/simple_calculator/configs/config.yml --port 10000 --public_base_url "http://nat.isamazing.com" ``` <img width="674" height="208" alt="image" src="https://github.com/user-attachments/assets/c9feb92f-68c5-4e31-86ff-cc52a8ee194e" /> ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/resources/contributing/index.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. ## Summary by CodeRabbit * **New Features** * Added optional public_base_url setting to let deployments advertise a custom external URL for the Agent Card. * **Tests** * Added test coverage ensuring public_base_url is respected and normalized (trailing slash behavior). * **Documentation** * New Kubernetes & Ingress deployment guide showing how to provide a public URL (including runtime/env-var injection examples) for proper Agent Card advertisement. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Will Killian (https://github.com/willkill07) URL: NVIDIA#1673
Description
Closes #1501
This PR adds a server-side override for the A2A Agent Card URL so deployments behind Kubernetes ingress/proxies can publish the correct external endpoint.
Sample Usage:
By Submitting this PR I confirm:
Summary by CodeRabbit
New Features
Tests
Documentation