✨ Feat: Add A2A protocol support for agent publishing and external agen…#2773
Open
✨ Feat: Add A2A protocol support for agent publishing and external agen…#2773
Conversation
…t discovery - A2A Server: Enable publishing platform agents as A2A agents with configurable endpoints, including database schema for agent registration and management - A2A Client: Support discovering and invoking external A2A agents through agent discovery modal, HTTP client, and agent adapter integration - Database: Add `a2a_agent` and `a2a_agent_endpoint` tables with foreign key relationships to existing agent tables - SDK: Implement `A2AAgentProxy` for SDK-level A2A agent invocation support - Frontend: Add A2A Server Settings Panel, Agent Discovery Modal, and corresponding hooks (`useA2AServerAgents`, `useExternalAgents`) - Backend API: Add `a2a_client_app.py` and `a2a_server_app.py` endpoints with service layer implementations - i18n: Update English and Chinese localization files with A2A-related translations - System Prompts: Update manager system prompt templates to support A2A protocol context
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end A2A (Agent-to-Agent) protocol support so platform agents can be published as A2A servers, and platform agents can discover/invoke external A2A agents (SDK, backend, and frontend).
Changes:
- SDK: Introduces an external A2A agent proxy + wrapper, and wires external A2A agents into manager/managed-agent creation.
- Backend: Adds A2A client/server services + FastAPI endpoints, plus new DB tables/models for external agents, relations, server registrations, tasks, messages, and artifacts.
- Frontend: Adds discovery + management UI (modal/panels/hooks) and publish-as-A2A option with preview, plus i18n updates.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/nexent/core/agents/nexent_agent.py | Appends external A2A wrappers into managed agents during agent creation. |
| sdk/nexent/core/agents/agent_model.py | Extends AgentConfig with external A2A agent configuration model. |
| sdk/nexent/core/agents/a2a_agent_proxy.py | Adds HTTP proxy/tooling to invoke external A2A agents and wrap them as managed agents. |
| frontend/types/agentConfig.ts | Adds is_a2a_server flag on Agent type. |
| frontend/stores/agentConfigStore.ts | Adds store support for external sub-agent ID lists. |
| frontend/services/api.ts | Adds A2A client/server management endpoint definitions. |
| frontend/services/agentVersionService.ts | Adds publish_as_a2a request + expanded publish response typing. |
| frontend/services/agentConfigService.ts | Maps backend is_a2a_server into frontend agent list data. |
| frontend/services/a2aService.ts | Adds frontend API service for A2A discovery, management, relations, and server settings. |
| frontend/public/locales/zh/common.json | Adds A2A-related Chinese translations. |
| frontend/public/locales/en/common.json | Adds A2A-related English translations. |
| frontend/hooks/agent/useExternalAgents.ts | Adds React Query hook for available external agents. |
| frontend/hooks/agent/useA2AServerAgents.ts | Adds React Query hook(s) for A2A server agents + helpers. |
| frontend/app/[locale]/agents/versions/AgentVersionPubulishModal.tsx | Adds “publish as A2A” switch and A2A publish preview modal. |
| frontend/app/[locale]/agents/components/agentManage/AgentList.tsx | Adds A2A settings entrypoint from agent list for A2A server agents. |
| frontend/app/[locale]/agents/components/AgentConfigComp.tsx | Adds entrypoint to open A2A discovery modal from agent config page. |
| frontend/app/[locale]/agents/components/agentConfig/CollaborativeAgent.tsx | Splits internal vs external sub-agent selection and rendering. |
| frontend/app/[locale]/agents/components/a2a/A2AServerSettingsPanel.tsx | Adds A2A Agent Card / endpoints preview + copy UI. |
| frontend/app/[locale]/agents/components/a2a/A2AAgentDiscoveryModal.tsx | Adds discovery + list UI for external A2A agents and protocol settings. |
| docker/sql/v2.0.0_0330_add_a2a_tables.sql | Adds A2A-related tables for discovery, relations, server registration, and task tracking. |
| docker/docker-compose.prod.yml | Exposes northbound port for external A2A access. |
| docker/.env.example | Documents NORTHBOUND_EXTERNAL_URL for public Agent Card URL generation. |
| backend/utils/a2a_http_client.py | Adds reusable aiohttp-based A2A HTTP client with retries + streaming. |
| backend/services/agent_version_service.py | Adds optional A2A server registration during version publish and returns card info. |
| backend/services/agent_service.py | Adds is_a2a_server in agent list by querying A2A server registrations. |
| backend/services/a2a_client_service.py | Implements external agent discovery/management/calling + health checks. |
| backend/services/a2a_agent_adapter.py | Adds adapter converting between A2A protocol payloads/events and internal agent execution. |
| backend/prompts/manager_system_prompt_template_zh.yaml | Extends manager prompt to list internal vs external A2A agents separately. |
| backend/prompts/manager_system_prompt_template_en.yaml | Extends manager prompt to list internal vs external A2A agents separately. |
| backend/database/db_models.py | Adds SQLAlchemy models for new A2A tables. |
| backend/consts/model.py | Adds publish_as_a2a to version publish request model. |
| backend/consts/exceptions.py | Adds A2A-specific exception types (task not found, unsupported op). |
| backend/consts/const.py | Adds NORTHBOUND_EXTERNAL_URL constant. |
| backend/consts/a2a_models.py | Adds Pydantic models for A2A protocol and API request/response shapes. |
| backend/apps/northbound_base_app.py | Adds northbound A2A endpoints: agent card, JSON-RPC, REST send/stream, task get. |
| backend/apps/config_app.py | Registers A2A client/server routers into the main API app. |
| backend/apps/agent_app.py | Wires publish_as_a2a through agent publish API. |
| backend/apps/a2a_server_app.py | Adds internal A2A server management endpoints (enable/disable/settings/list). |
| backend/apps/a2a_client_app.py | Adds A2A client endpoints for discovery/agents/relations/nacos configs. |
| backend/agents/create_agent_info.py | Loads external sub-agents into agent config + manager prompt context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… through an exception' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
… through an exception' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…0行才定义。这构成了循环引用/前向引用
…时,之前会错误地使用 REST 的 url,现在会正确使用 JSON-RPC 的 url
… 'agent_id' is not defined,根本走不到 return 语句
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feat: Add A2A protocol support for agent publishing and external agent discovery
A2A协议指导:https://dcnvjn24oieg.feishu.cn/docx/VrhSdKTy5ofXVMxxcxZcoQann9e
a2aserver.mp4
测试脚本:test_a2a_api.sh

A2A Agent支持根据不同格式的请求,返回不同格式的A2A响应
演示视频
a2aclient.mp4
测试: