Skip to content

feat(a2a): integrate Agent2Agent (A2A) protocol for enhanced agent in…#211

Merged
nebukaga merged 4 commits intodevelopfrom
feature/a2a_support_in_0.8
Dec 29, 2025
Merged

feat(a2a): integrate Agent2Agent (A2A) protocol for enhanced agent in…#211
nebukaga merged 4 commits intodevelopfrom
feature/a2a_support_in_0.8

Conversation

@zomux
Copy link
Copy Markdown
Contributor

@zomux zomux commented Dec 28, 2025

…teroperability

  • Introduced full support for the A2A protocol, enabling seamless communication between AI agents built on various frameworks (LangGraph, CrewAI, Pydantic AI, etc.).
  • Implemented A2A transport via HTTP at the /a2a endpoint, consolidating agent communication under a unified transport layer.
  • Added comprehensive documentation and examples to facilitate user adoption and understanding of A2A capabilities.
  • Enhanced agent registry and task management to support A2A-specific functionalities, including agent card discovery and task lifecycle management.
  • Updated network configuration templates to include A2A support across various demo setups.

…teroperability

- Introduced full support for the A2A protocol, enabling seamless communication between AI agents built on various frameworks (LangGraph, CrewAI, Pydantic AI, etc.).
- Implemented A2A transport via HTTP at the `/a2a` endpoint, consolidating agent communication under a unified transport layer.
- Added comprehensive documentation and examples to facilitate user adoption and understanding of A2A capabilities.
- Enhanced agent registry and task management to support A2A-specific functionalities, including agent card discovery and task lifecycle management.
- Updated network configuration templates to include A2A support across various demo setups.
Copilot AI review requested due to automatic review settings December 28, 2025 17:55
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
openagents-studio Ready Ready Preview, Comment Dec 29, 2025 4:22am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces comprehensive support for the A2A (Agent2Agent) protocol v0.3, enabling seamless communication between AI agents built on various frameworks. Key changes include:

  • Full A2A protocol implementation with HTTP/JSON-RPC transport at /a2a endpoint
  • Agent registry for managing remote A2A agents with health checks and card refresh
  • Task lifecycle management with in-memory store
  • Cross-protocol communication between gRPC, WebSocket, HTTP, and A2A agents
  • Comprehensive test coverage across all A2A components
  • Configuration templates updated for all demo networks

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 34 comments.

Show a summary per file
File Description
tests/a2a/test_remote_agent_registry.py Tests for A2A agent registry including announcement, withdrawal, health checks, and card refresh
tests/a2a/test_cross_protocol_communication.py Integration tests verifying communication between gRPC and A2A agents
tests/a2a/test_a2a_transport.py Tests for A2A transport including JSON-RPC endpoints, authentication, and task management
tests/a2a/test_a2a_task_store.py Tests for task store implementation with LRU eviction and callbacks
tests/a2a/test_a2a_models.py Tests for A2A protocol data models (tasks, messages, agent cards)
tests/a2a/test_a2a_converters.py Tests for event/message conversion utilities
tests/a2a/test_a2a_connector.py Tests for A2A network connector for external A2A servers
src/openagents/utils/a2a_converters.py Converters between OpenAgents events and A2A messages/tasks
src/openagents/models/a2a.py Pydantic models for A2A protocol (tasks, messages, agent cards, JSON-RPC)
src/openagents/models/transport.py Transport model updates with A2A support and remote agent status
src/openagents/core/transports/http.py HTTP transport extended with A2A protocol at /a2a endpoint
src/openagents/core/transports/a2a.py Standalone A2A transport implementation
src/openagents/core/topology.py Topology integration with A2A registry and agent management
src/openagents/core/connectors/a2a_connector.py Connector for OpenAgents agents to communicate with external A2A servers
src/openagents/core/a2a_task_store.py Task store abstraction with in-memory implementation
Network YAML templates Updated configurations with A2A transport enabled
examples/cross_protocol_agents_example.py Example demonstrating gRPC-A2A cross-protocol communication

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

topology.agent_registry["grpc-translator"] = grpc_connection

# Announce A2A agent via registry
a2a_connection = await a2a_registry.announce_agent(
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

Variable a2a_connection is not used.

Suggested change
a2a_connection = await a2a_registry.announce_agent(
await a2a_registry.announce_agent(

Copilot uses AI. Check for mistakes.
- events/send - Send an event through the network
"""

import asyncio
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

Import of 'asyncio' is not used.

Suggested change
import asyncio

Copilot uses AI. Check for mistakes.
from aiohttp import web

from .base import Transport
from openagents.models.transport import TransportType, AgentConnection, RemoteAgentStatus
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

Import of 'AgentConnection' is not used.
Import of 'RemoteAgentStatus' is not used.

Suggested change
from openagents.models.transport import TransportType, AgentConnection, RemoteAgentStatus
from openagents.models.transport import TransportType

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +61
from openagents.models.a2a import (
AgentCard,
AgentSkill,
AgentCapabilities,
AgentProvider,
Task,
TaskState,
TaskStatus,
A2AMessage,
Artifact,
TextPart,
DataPart,
Role,
JSONRPCRequest,
JSONRPCResponse,
JSONRPCError,
A2AErrorCode,
parse_parts,
create_text_message,
)
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

Import of 'Task' is not used.
Import of 'DataPart' is not used.
Import of 'JSONRPCResponse' is not used.
Import of 'JSONRPCError' is not used.

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +37
TaskStatus,
A2AMessage,
Artifact,
TextPart,
DataPart,
Role,
Part,
PushNotificationConfig,
parse_parts,
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

Import of 'DataPart' is not used.
Import of 'TaskStatus' is not used.
Import of 'Artifact' is not used.
Import of 'TextPart' is not used.
Import of 'Role' is not used.
Import of 'Part' is not used.
Import of 'parse_parts' is not used.

Suggested change
TaskStatus,
A2AMessage,
Artifact,
TextPart,
DataPart,
Role,
Part,
PushNotificationConfig,
parse_parts,
A2AMessage,
PushNotificationConfig,

Copilot uses AI. Check for mistakes.
}
)

network = AgentNetwork(config)
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

Call to AgentNetwork.init with too few arguments; should be no fewer than 2.

Suggested change
network = AgentNetwork(config)
network = AgentNetwork(config, asyncio.get_running_loop())

Copilot uses AI. Check for mistakes.
polling_task.cancel()
try:
await polling_task
except asyncio.CancelledError:
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except asyncio.CancelledError:
except asyncio.CancelledError:
# Expected when we cancel the polling task during disconnect; safe to ignore.

Copilot uses AI. Check for mistakes.
try:
await polling_task
except asyncio.CancelledError:
pass
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
pass
# Suppress cancellation error: this is expected when stopping background polling.
return

Copilot uses AI. Check for mistakes.
self._card_refresh_task.cancel()
try:
await self._card_refresh_task
except asyncio.CancelledError:
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
self._health_check_task.cancel()
try:
await self._health_check_task
except asyncio.CancelledError:
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
- Introduced a new job in the pytest workflow to run tests for the Agent2Agent (A2A) protocol.
- Configured environment variables for the A2A tests to ensure proper execution and compatibility.
- Updated the GitHub Actions workflow to include pytest-aiohttp in the dependencies, enhancing the testing capabilities for asynchronous HTTP requests.
@nebukaga nebukaga merged commit e465f93 into develop Dec 29, 2025
6 checks passed
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.

3 participants