diff --git a/contributing/samples/a2a_auth/README.md b/contributing/samples/a2a_auth/README.md index a732c03c5..2e4aa204d 100644 --- a/contributing/samples/a2a_auth/README.md +++ b/contributing/samples/a2a_auth/README.md @@ -157,12 +157,43 @@ You can extend this sample by: - Adding audit logging for authentication events - Implementing multi-tenant OAuth token management +## Deployment to Other Environments + +When deploying the remote BigQuery A2A agent to different environments (e.g., Cloud Run, different hosts/ports), you **must** update the `url` field in the agent card JSON file: + +### Local Development +```json +{ + "url": "http://localhost:8001/a2a/bigquery_agent", + ... +} +``` + +### Cloud Run Example +```json +{ + "url": "https://your-bigquery-service-abc123-uc.a.run.app/a2a/bigquery_agent", + ... +} +``` + +### Custom Host/Port Example +```json +{ + "url": "https://your-domain.com:9000/a2a/bigquery_agent", + ... +} +``` + +**Important:** The `url` field in `remote_a2a/bigquery_agent/agent.json` must point to the actual RPC endpoint where your remote BigQuery A2A agent is deployed and accessible. + ## Troubleshooting **Connection Issues:** - Ensure the local ADK web server is running on port 8000 - Ensure the remote A2A server is running on port 8001 - Check that no firewall is blocking localhost connections +- **Verify the `url` field in `remote_a2a/bigquery_agent/agent.json` matches the actual deployed location of your remote A2A server** - Verify the agent card URL passed to RemoteA2AAgent constructor matches the running A2A server @@ -182,3 +213,4 @@ You can extend this sample by: - Check the logs for both the local ADK web server and remote A2A server - Verify OAuth tokens are properly passed between agents - Ensure agent instructions are clear about authentication requirements +- **Double-check that the RPC URL in the agent.json file is correct and accessible** diff --git a/contributing/samples/a2a_auth/remote_a2a/bigquery_agent/agent.json b/contributing/samples/a2a_auth/remote_a2a/bigquery_agent/agent.json index 2e11e74fa..b91fd7966 100644 --- a/contributing/samples/a2a_auth/remote_a2a/bigquery_agent/agent.json +++ b/contributing/samples/a2a_auth/remote_a2a/bigquery_agent/agent.json @@ -24,6 +24,6 @@ "tags": ["authentication", "oauth", "security"] } ], - "url": "http://localhost:8000/a2a/bigquery_agent", + "url": "http://localhost:8001/a2a/bigquery_agent", "version": "1.0.0" } diff --git a/contributing/samples/a2a_basic/README.md b/contributing/samples/a2a_basic/README.md index 2a856aa53..ca61101c2 100644 --- a/contributing/samples/a2a_basic/README.md +++ b/contributing/samples/a2a_basic/README.md @@ -107,15 +107,47 @@ You can extend this sample by: - Adding persistent state management - Integrating with external APIs or databases +## Deployment to Other Environments + +When deploying the remote A2A agent to different environments (e.g., Cloud Run, different hosts/ports), you **must** update the `url` field in the agent card JSON file: + +### Local Development +```json +{ + "url": "http://localhost:8001/a2a/check_prime_agent", + ... +} +``` + +### Cloud Run Example +```json +{ + "url": "https://your-service-abc123-uc.a.run.app/a2a/check_prime_agent", + ... +} +``` + +### Custom Host/Port Example +```json +{ + "url": "https://your-domain.com:9000/a2a/check_prime_agent", + ... +} +``` + +**Important:** The `url` field in `remote_a2a/check_prime_agent/agent.json` must point to the actual RPC endpoint where your remote A2A agent is deployed and accessible. + ## Troubleshooting **Connection Issues:** - Ensure the local ADK web server is running on port 8000 - Ensure the remote A2A server is running on port 8001 - Check that no firewall is blocking localhost connections +- **Verify the `url` field in `remote_a2a/check_prime_agent/agent.json` matches the actual deployed location of your remote A2A server** - Verify the agent card URL passed to RemoteA2AAgent constructor matches the running A2A server **Agent Not Responding:** - Check the logs for both the local ADK web server on port 8000 and remote A2A server on port 8001 - Verify the agent instructions are clear and unambiguous +- **Double-check that the RPC URL in the agent.json file is correct and accessible** diff --git a/contributing/samples/a2a_human_in_loop/README.md b/contributing/samples/a2a_human_in_loop/README.md index b985e6b9b..5f90fad9f 100644 --- a/contributing/samples/a2a_human_in_loop/README.md +++ b/contributing/samples/a2a_human_in_loop/README.md @@ -116,18 +116,50 @@ You can extend this sample by: - Integrating with external approval systems or databases - Implementing approval timeouts and escalation procedures +## Deployment to Other Environments + +When deploying the remote approval A2A agent to different environments (e.g., Cloud Run, different hosts/ports), you **must** update the `url` field in the agent card JSON file: + +### Local Development +```json +{ + "url": "http://localhost:8001/a2a/human_in_loop", + ... +} +``` + +### Cloud Run Example +```json +{ + "url": "https://your-approval-service-abc123-uc.a.run.app/a2a/human_in_loop", + ... +} +``` + +### Custom Host/Port Example +```json +{ + "url": "https://your-domain.com:9000/a2a/human_in_loop", + ... +} +``` + +**Important:** The `url` field in `remote_a2a/human_in_loop/agent.json` must point to the actual RPC endpoint where your remote approval A2A agent is deployed and accessible. + ## Troubleshooting **Connection Issues:** - Ensure the local ADK web server is running on port 8000 - Ensure the remote A2A server is running on port 8001 - Check that no firewall is blocking localhost connections +- **Verify the `url` field in `remote_a2a/human_in_loop/agent.json` matches the actual deployed location of your remote A2A server** - Verify the agent card URL passed to RemoteA2AAgent constructor matches the running A2A server **Agent Not Responding:** - Check the logs for both the local ADK web server on port 8000 and remote A2A server on port 8001 - Verify the agent instructions are clear and unambiguous - Ensure long-running tool responses are properly formatted with matching IDs +- **Double-check that the RPC URL in the agent.json file is correct and accessible** **Approval Workflow Issues:** - Verify that updated tool responses use the same `id` and `name` as the original function call diff --git a/contributing/samples/a2a_human_in_loop/remote_a2a/human_in_loop/agent.json b/contributing/samples/a2a_human_in_loop/remote_a2a/human_in_loop/agent.json index 17153b7cf..c0b850cb5 100644 --- a/contributing/samples/a2a_human_in_loop/remote_a2a/human_in_loop/agent.json +++ b/contributing/samples/a2a_human_in_loop/remote_a2a/human_in_loop/agent.json @@ -24,6 +24,6 @@ "tags": ["expenses", "processing", "employee-services"] } ], - "url": "http://localhost:8000/a2a/human_in_loop", + "url": "http://localhost:8001/a2a/human_in_loop", "version": "1.0.0" } diff --git a/src/google/adk/cli/fast_api.py b/src/google/adk/cli/fast_api.py index bc1a75dda..7d93b5436 100644 --- a/src/google/adk/cli/fast_api.py +++ b/src/google/adk/cli/fast_api.py @@ -352,8 +352,6 @@ async def _get_a2a_runner_async() -> Runner: logger.info("Setting up A2A agent: %s", app_name) try: - a2a_rpc_path = f"http://{host}:{port}/a2a/{app_name}" - agent_executor = A2aAgentExecutor( runner=create_a2a_runner_loader(app_name), ) @@ -365,7 +363,6 @@ async def _get_a2a_runner_async() -> Runner: with (p / "agent.json").open("r", encoding="utf-8") as f: data = json.load(f) agent_card = AgentCard(**data) - agent_card.url = a2a_rpc_path a2a_app = A2AStarletteApplication( agent_card=agent_card,