Skip to content

feat(agentregistry): add ADK and Agent Engine samples with CI scaffolding - #15002

Open
fatoboist wants to merge 2 commits into
mainfrom
feat/agentregistry-adk-samples
Open

fatoboist wants to merge 2 commits into
mainfrom
feat/agentregistry-adk-samples

Conversation

@fatoboist

Copy link
Copy Markdown
Contributor

Description

Adds CI scaffolding, README, and core ADK / Vertex AI Agent Engine samples for Agent Registry under agentregistry/adk/ (PR A of migrating inline Agent Registry documentation snippets to GitHub; internal tracking: b/581932768).

Files added / updated

  • agentregistry/README.md: Quickstart, sample index, and test environment variable documentation.
  • agentregistry/adk/requirements.txt & requirements-test.txt
  • agentregistry/adk/noxfile_config.py & conftest.py
  • agentregistry/adk/compose_multi_agent.py + compose_multi_agent_test.py (agentregistry_adk_initialize_client, agentregistry_adk_compose_multi_agent)
  • agentregistry/adk/clone_remote_agent.py + clone_remote_agent_test.py (agentregistry_adk_clone_remote_agent)
  • agentregistry/adk/discover_agents_and_toolsets.py + discover_agents_and_toolsets_test.py (agentregistry_adk_discover_agents_and_toolsets)
  • agentregistry/adk/deploy_agent_runtime.py + deploy_agent_runtime_test.py (agentregistry_deploy_agent_runtime)

API & Test Infrastructure Request

To run the integration tests in CI on the shared test projects (python-docs-samples-tests-310 through python-docs-samples-tests-314, specifically python-docs-samples-tests-314), please:

  1. Enable APIs: Enable agentregistry.googleapis.com (and verify aiplatform.googleapis.com is enabled).
  2. Register test fixtures & configure env vars:
    • Register a mock A2A agent and set AGENTREGISTRY_TEST_AGENT_ID
    • Register an MCP server and set AGENTREGISTRY_TEST_MCP_SERVER_ID
    • Provide a Cloud Storage staging bucket URI in AGENTREGISTRY_TEST_STAGING_BUCKET for deploy_agent_runtime_test.py

(Tests skip cleanly when these fixture environment variables are not yet set.)

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended. (Pending agentregistry.googleapis.com enablement and fixture setup in the shared test project.)

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@fatoboist
fatoboist requested review from a team as code owners November 27, 2026 17:01
@snippet-bot

snippet-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 5 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label Bot added api: agentregistry Issues related to the Agent Registry API. samples Issues that are directly related to samples. labels Nov 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Python samples for the Google Cloud Agent Registry using the Agent Development Kit (ADK) and Vertex AI Agent Engine, including sample scripts, tests, and configuration files. The review feedback highlights several improvement opportunities: replacing httpx.AsyncClient with synchronous httpx.Client inside a with statement in synchronous functions, utilizing self.creds.before_request for robust credential application, and updating the Python test configuration in noxfile_config.py to align with the minimum supported Python versions of the project's dependencies.

Comment on lines +52 to +60
httpx_client = httpx.AsyncClient(
auth=GoogleAuth(),
timeout=httpx.Timeout(60.0),
)

base_remote_agent = registry.get_remote_a2a_agent(
agent_name=agent_name,
httpx_client=httpx_client,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Since clone_remote_agent is a synchronous function, using httpx.AsyncClient is inappropriate and can lead to unclosed client warnings or event loop issues. Use the synchronous httpx.Client instead, and wrap it in a with statement to ensure connections are properly closed.

    with httpx.Client(
        auth=GoogleAuth(),
        timeout=httpx.Timeout(60.0),
    ) as httpx_client:
        base_remote_agent = registry.get_remote_a2a_agent(
            agent_name=agent_name,
            httpx_client=httpx_client,
        )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping httpx.AsyncClient without a with block here: AgentRegistry.get_remote_a2a_agent() expects httpx.AsyncClient | None and passes it to ADK's RemoteA2aAgent, which executes async HTTP calls when the returned LlmAgent is invoked. Using a synchronous httpx.Client would fail at runtime, and a with block inside clone_remote_agent() would close the client before the returned orchestrators run.

Comment on lines +56 to +63
httpx_client = httpx.AsyncClient(
auth=GoogleAuth(),
timeout=httpx.Timeout(60.0),
)
my_remote_agent = registry.get_remote_a2a_agent(
agent_name=agent_name,
httpx_client=httpx_client,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Since compose_multi_agent is a synchronous function, using httpx.AsyncClient is inappropriate and can lead to unclosed client warnings or event loop issues. Use the synchronous httpx.Client instead, and wrap it in a with statement to ensure connections are properly closed.

Suggested change
httpx_client = httpx.AsyncClient(
auth=GoogleAuth(),
timeout=httpx.Timeout(60.0),
)
my_remote_agent = registry.get_remote_a2a_agent(
agent_name=agent_name,
httpx_client=httpx_client,
)
with httpx.Client(
auth=GoogleAuth(),
timeout=httpx.Timeout(60.0),
) as httpx_client:
my_remote_agent = registry.get_remote_a2a_agent(
agent_name=agent_name,
httpx_client=httpx_client,
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping httpx.AsyncClient without a with block here: AgentRegistry.get_remote_a2a_agent() expects httpx.AsyncClient | None and passes it to ADK's RemoteA2aAgent, which executes async HTTP calls when the returned LlmAgent is invoked. Using a synchronous httpx.Client would fail at runtime, and a with block inside compose_multi_agent() would close the client before the returned orchestrator runs.

Comment thread agentregistry/adk/clone_remote_agent.py Resolved
Comment thread agentregistry/adk/noxfile_config.py Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: agentregistry Issues related to the Agent Registry API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants