Skip to content

feat: add working A2A server sample - #209

Draft
Tsuyoshi Ushio (TsuyoshiUshio) wants to merge 2 commits into
tsuyoshiushio-a2a-frd-and-designfrom
tsuyoshiushio-p3-working-a2a-sample
Draft

feat: add working A2A server sample#209
Tsuyoshi Ushio (TsuyoshiUshio) wants to merge 2 commits into
tsuyoshiushio-a2a-frd-and-designfrom
tsuyoshiushio-p3-working-a2a-sample

Conversation

@TsuyoshiUshio

@TsuyoshiUshio Tsuyoshi Ushio (TsuyoshiUshio) commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the experimental P3 simple non-SSE A2A server above #208. It adds opt-in typed A2A configuration, per-agent Agent Card and JSON-RPC routes, public Microsoft Agent Framework hosting-a2a conversion, and reuse of the existing authenticated non-streaming runtime runner.

The runnable incident-triage sample now uses a real MAF A2AAgent as its primary caller. That client runs in an isolated MAF 1.15+ environment across HTTP, so the server/runtime remains on its verified core 1.13 tuple.

Experimental P3 profile

  • Accepts exact A2A wire version 1.0; an absent version is treated as 0.3 and rejected.
  • Supports only non-streaming SendMessage requests containing user text parts and returns one direct agent Message.
  • Accepts both returnImmediately values; the flag has no effect for a direct Message.
  • Explicitly rejects Tasks, task continuation, streaming, subscribe/cancel, push notifications, REST, non-text parts, and outbound client tools.
  • Agent Card URLs are explicitly configured per agent; cards advertise streaming: false and pushNotifications: false.
  • Preserves the existing HTTP auth boundary, scoped runtime sessions, security/policy behavior, builtin routes, and shared DFApp workflow bindings.
  • Enforces bounded request, part, text, response, and per-agent in-flight execution limits; runtime metadata is allowlisted to response text only.

P4 Task persistence and P5 streaming are intentionally not included. Durable dependency optionalization is also out of scope. Any runtime-wide MAF core/OpenAI/Foundry upgrade is a separate standalone compatibility-validation PR (PV), not bundled with P3/P4/P5 or optional-Durable work.

Runnable incident-triage story

From the repository root, create independent server and client environments:

# Server: editable runtime + [a2a], preserving core 1.13
python -m venv .venv-server
.\.venv-server\Scripts\Activate.ps1
python -m pip install -e ".[a2a]"

# Client: only agent-framework-a2a and its core 1.15+ closure
python -m venv samples\a2a-incident-triage\.venv-client
.\samples\a2a-incident-triage\.venv-client\Scripts\Activate.ps1
python -m pip install -r samples\a2a-incident-triage\requirements-client.txt

Copy samples\a2a-incident-triage\src\local.settings.template.json to local.settings.json, configure the repository's normal model credentials, start Azurite separately, and run the host from the server environment:

.\.venv-server\Scripts\Activate.ps1
cd samples\a2a-incident-triage\src
func start

In a second terminal, use the MAF client. It resolves the explicit /agents/main/.well-known/agent-card.json path, selects JSONRPC 1.0, and calls A2AAgent.run():

.\samples\a2a-incident-triage\.venv-client\Scripts\Activate.ps1
cd samples\a2a-incident-triage
python client.py

Use python raw_client.py (and --return-immediately) to inspect and modify the raw Agent Card/JSON-RPC wire contract. Both clients accept --function-key through public HTTP client headers.

Dependencies

The server/runtime [a2a] extra remains:

  • agent-framework-hosting-a2a==1.0.0a260730
  • agent-framework-hosting==1.0.0a260730
  • a2a-sdk[http-server]==1.1.2
  • MAF core 1.13.0

The client-only sample requirements pin agent-framework-a2a==1.0.0b260821, which resolves a MAF core 1.15+ client environment. It does not install the editable runtime and is not added to root runtime/dev extras. Existing OpenAI/Foundry pins and the mandatory Durable dependency remain unchanged.

Validation

  • python -m ruff check src tests
  • python -m mypy src
  • python eng/scripts/generate_config_reference.py --check
  • python -m pytest --cache-clear --cov=./src/azure_functions_agents --cov-report=xml --cov-branch tests — 1,230 passed, 58 deselected
  • Real Functions-host E2E through isolated A2AAgent.run() plus raw JSON-RPC passed
  • Client-only closure: agent-framework-a2a 1.0.0b260821, core 1.16.0, SDK 1.1.2, no runtime package
  • Python 3.13 and 3.14 clean server-wheel closure remains core 1.13.0 with the original hosting tuple
  • Independent follow-up review found no significant issue

Stack

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4a4a082c-9c31-498a-b398-82c5a94e3190
@TsuyoshiUshio
Tsuyoshi Ushio (TsuyoshiUshio) added this pull request to stack #210 September 9, 2026 06:08
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4a4a082c-9c31-498a-b398-82c5a94e3190
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.

1 participant