Skip to content

[AgentServer] Add A2A protocol host package - #49491

Open
Hameed Kunkanoor (Hameedkunkanoor) wants to merge 1 commit into
Azure:mainfrom
Hameedkunkanoor:feature/agentserver-a2a
Open

Hameed Kunkanoor (Hameedkunkanoor) wants to merge 1 commit into
Azure:mainfrom
Hameedkunkanoor:feature/agentserver-a2a

Conversation

@Hameedkunkanoor

Copy link
Copy Markdown
Contributor

Description

Adds the initial preview azure-ai-agentserver-a2a package for hosting native A2A v1.0 agents in Azure AI Hosted Agent containers.

The package:

  • exposes the native A2A JSON-RPC handler at POST /invocations/a2a;
  • serves the native agent card at GET /invocations/a2a/.well-known/agent-card.json;
  • binds Foundry call, user, and session identity to request-scoped context;
  • composes cooperatively with other Agent Server protocol hosts;
  • includes standalone and multi-protocol samples, tests, API review artifacts, and CI registration.

Validation

  • python -m pytest tests -q — 9 passed
  • azpysdk pylint . — 10.00/10
  • azpysdk mypy . — passed, including samples
  • azpysdk pyright . — passed
  • package wheel and source distribution build — passed
  • twine check dist/* — passed
  • git diff --check — passed

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Hosted Agents sdk/agentserver/* label Oct 12, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@Hameedkunkanoor

Copy link
Copy Markdown
Contributor Author

Companion Foundry sample PR: microsoft-foundry/foundry-samples#1066

Copilot AI 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.

🟡 Changes recommended

Empty identity headers can be forwarded as valid Foundry call identifiers.

1 open finding
What changed in this PR

Adds the preview A2A v1.0 protocol host package for Azure AI Hosted Agents.

Changes:

  • Implements canonical A2A routes and request-scoped Foundry identity.
  • Adds standalone/multi-protocol samples and route tests.
  • Registers packaging, CI, typing, and API review metadata.
File Description
sdk/​agentserver/​tests.yml Adds A2A to test targeting.
sdk/​agentserver/​cspell.yaml Configures A2A spelling exclusions.
sdk/​agentserver/​ci.yml Registers the package artifact.
azure-ai-agentserver-a2a/​tests/​test_server_routes.py Tests routing, context, and composition.
azure-ai-agentserver-a2a/​tests/​conftest.py Provides an ASGI client fixture.
samples/​02-multi-protocol/​requirements.txt Declares sample dependencies.
samples/​02-multi-protocol/​multi_protocol.py Demonstrates protocol composition.
samples/​01-hello-world/​hello_world.py Demonstrates standalone A2A hosting.
azure-ai-agentserver-a2a/​README.md Documents installation and usage.
azure-ai-agentserver-a2a/​pyrightconfig.json Configures Pyright.
azure-ai-agentserver-a2a/​pyproject.toml Defines package metadata and dependencies.
azure-ai-agentserver-a2a/​mypy.ini Configures mypy.
azure-ai-agentserver-a2a/​MANIFEST.in Defines source distribution contents.
azure-ai-agentserver-a2a/​LICENSE Adds the MIT license.
azure-ai-agentserver-a2a/​dev_requirements.txt Defines development dependencies.
azure-ai-agentserver-a2a/​CHANGELOG.md Records the initial preview.
a2a/​py.typed Marks the package as typed.
a2a/​_version.py Defines package version 1.0.0b1.
a2a/​_host.py Implements the A2A host and context middleware.
a2a/​__init__.py Exports the public host API.
agentserver/​__init__.py Extends the namespace package.
ai/​__init__.py Extends the namespace package.
azure/​__init__.py Extends the namespace package.
api.metadata.yml Records API snapshot metadata.
api.md Captures the public API surface.

🧠 Review effort: Balanced

Comment on lines +56 to +58
call_id=headers.get(FOUNDRY_CALL_ID),
user_id=headers.get(USER_ID),
session_id=headers.get(_SESSION_ID_HEADER),
@Hameedkunkanoor

Copy link
Copy Markdown
Contributor Author

Hosted A2A end-to-end validation passed on 2026-10-12.

Validated against an active Foundry hosted-agent version:

  1. azd ai agent show reported the hosted version as active with protocol a2a version 1.0.0.
  2. The dedicated native client authenticated with AzureCliCredential.
  3. The client discovered the public Agent Card through agentCard/v1.0.
  4. It sent an A2A v1 SendMessageRequest over the public Foundry endpoint.
  5. The container created/completed an A2A Task and returned an artifact.
  6. The client asserted the exact artifact text and printed: Echo: hosted A2A validation 2026-10-12.

This validates the full Foundry authentication, public A2A routing, container hosting, native SDK request handling, and response artifact path—not only local ASGI behavior.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hosted Agents sdk/agentserver/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants