Skip to content

feat(a2a): Infer agent cards from ADK agents#6180

Open
jordanchendev wants to merge 1 commit into
google:mainfrom
jordanchendev:fix/2237-infer-agent-card
Open

feat(a2a): Infer agent cards from ADK agents#6180
jordanchendev wants to merge 1 commit into
google:mainfrom
jordanchendev:fix/2237-infer-agent-card

Conversation

@jordanchendev

@jordanchendev jordanchendev commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2237.

This lets get_fast_api_app(..., a2a=True) expose standard ADK agent
directories even when they do not include an explicit agent.json. Existing
agent.json files still take precedence; otherwise the loaded ADK agent is
used to build an AgentCard.

Testing

Passed:

uv run python -m pytest tests/unittests/cli/test_fast_api_a2a.py tests/unittests/cli/test_fast_api.py -k a2a tests/unittests/a2a/utils/test_agent_card_builder.py tests/unittests/a2a/utils/test_agent_to_a2a.py -q

Result:

113 passed, 75 deselected, 61 warnings

Passed:

uv run python -m pytest tests/unittests/models/test_interactions_utils.py -q

Result:

77 passed, 4 warnings

Passed:

uv run pre-commit run --all-files

Result:

check yaml...............................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
pyproject-fmt............................................................Passed
ruff (legacy alias)......................................................Passed
isort....................................................................Passed
pyink....................................................................Passed
addlicense...............................................................Passed
Check new Python files have _ prefix.....................................Passed
mdformat.................................................................Passed

Not rerun after rebasing:

tox

I previously ran py312,py313 tox and hit failures in
tests/unittests/models/test_interactions_utils.py on the old base. After
rebasing onto latest origin/main, that previously failing test file now
passes as shown above.

@jordanchendev jordanchendev marked this pull request as ready for review June 23, 2026 02:44
@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Jun 24, 2026
Allow A2A setup in get_fast_api_app to serve ADK agent directories without a checked-in agent.json by building the AgentCard from the loaded ADK agent.

Fixes google#2237

Tests:

uv run python -m pytest tests/unittests/cli/test_fast_api_a2a.py tests/unittests/cli/test_fast_api.py -k a2a tests/unittests/a2a/utils/test_agent_card_builder.py tests/unittests/a2a/utils/test_agent_to_a2a.py -q

uv run pre-commit run --files src/google/adk/cli/fast_api.py tests/unittests/cli/test_fast_api_a2a.py
@jordanchendev jordanchendev force-pushed the fix/2237-infer-agent-card branch from 133fca9 to 89c38c7 Compare June 24, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infer agent-card.json from ADK agent

2 participants