Skip to content

Add A2A protocol v0.3.0 support#36

Open
vzzyl wants to merge 1 commit intodigitalocean:mainfrom
vzzyl:add-a2a-protocol-support
Open

Add A2A protocol v0.3.0 support#36
vzzyl wants to merge 1 commit intodigitalocean:mainfrom
vzzyl:add-a2a-protocol-support

Conversation

@vzzyl
Copy link

@vzzyl vzzyl commented Feb 24, 2026

Summary

  • Adds A2A (Agent-to-Agent) protocol v0.3.0 support for Gradient agents
  • Implements create_a2a_server() to wrap any @entrypoint agent with A2A protocol
  • Supports message/send, tasks/get, tasks/cancel, and agent card discovery
  • Clean hexagonal architecture: domain validation/transformation, adapters, infrastructure
  • 33 tests (unit + e2e), text-only MVP

New dependency

a2a-sdk[http-server]>=0.3.0 (optional, pip install gradient-adk[a2a])

Test plan

  • pytest tests/test_a2a/ -v (33 tests)
  • pytest tests/ -v (no regressions — 294 passed, 16 skipped)
  • CI passes

🤖 Generated with Claude Code

@vzzyl vzzyl force-pushed the add-a2a-protocol-support branch from 17ec781 to 74b7121 Compare February 24, 2026 19:31
@vzzyl vzzyl marked this pull request as ready for review February 24, 2026 19:31
Copy link

@ypeng1 ypeng1 left a comment

Choose a reason for hiding this comment

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

Please provide documentation on how A2A protocol v0.3.0 works here. You may have a separate A2A.md file explaining the flow. Look at our README.md as its formatting example.

1. Ensure you have gradient-adk and a2a-sdk installed:
pip install gradient-adk[a2a]
2. Run: gradient agent run
3. The agent will be available at http://localhost:8080 with both Gradient and A2A protocols
Copy link

Choose a reason for hiding this comment

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

How does it work for App Platform deployment here? Since you don't know the URL prior to the deployment.

Copy link
Author

Choose a reason for hiding this comment

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

base_url now reads from the A2A_BASE_URL environment variable at server startup, falling back to http://localhost:8000 for local development. On App Platform, set A2A_BASE_URL to your app's public URL. The example docstring has been updated to document this.

@vzzyl vzzyl force-pushed the add-a2a-protocol-support branch 2 times, most recently from 0a7c8d6 to ae32bf3 Compare March 3, 2026 19:35
@vzzyl
Copy link
Author

vzzyl commented Mar 3, 2026

Addressed both review comments:

  1. Documentation: Added an A2A Protocol Support section to the README following the existing formatting pattern. Covers wrapping an agent, deployment configuration (A2A_BASE_URL env var), and supported operations.

  2. App Platform deployment: create_a2a_server() now reads base_url from the A2A_BASE_URL environment variable at server startup, falling back to http://localhost:8000 for local development. On App Platform, set A2A_BASE_URL to your app's public URL.

Additional improvements in this update:

  • Removed accidentally committed .venv/ directory
  • Added .venv/ to .gitignore
  • Added cancellation race and idempotency tests
  • 45 tests passing (33 unit + 12 integration)

Wrap any @entrypoint agent as an A2A v0.3.0 server with a single call
to create_a2a_server(). Implements message/send, tasks/get, tasks/cancel
and agent discovery via /.well-known/agent-card.json.

- Hexagonal architecture: domain validation/transformation, adapters,
  infrastructure
- Text-only MVP; streaming, push notifications, and authenticated
  extended cards explicitly disabled via AgentCard capability flags
- base_url reads from A2A_BASE_URL env var for deployment flexibility
- 45 tests (unit + integration), including cancel-race coverage
- README documentation with protocol flow and deployment guide
- New optional dependency: pip install gradient-adk[a2a]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vzzyl vzzyl force-pushed the add-a2a-protocol-support branch from ae32bf3 to 8dd643d Compare March 3, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants