Skip to content

Add native A2A Echo and Copilot web-search travel samples - #1158

Open
Hameed Kunkanoor (Hameedkunkanoor) wants to merge 14 commits into
mainfrom
feature/native-a2a-echo-travel-web-search
Open

Hameed Kunkanoor (Hameedkunkanoor) wants to merge 14 commits into
mainfrom
feature/native-a2a-echo-travel-web-search

Conversation

@Hameedkunkanoor

Copy link
Copy Markdown
Contributor

Repository-branch replacement for #1144

This PR carries the exact reviewed head of #1144
(4e60cda7322823f49c3412dd08b57ee2db17e6e3) on a branch in
microsoft-foundry/foundry-samples, rather than the contributor fork.
See #1144 for the earlier review discussions and fixes. That PR remains open
for review history until this replacement is confirmed.

The original PR's required Foundry Samples Hosted Agents CI check had not
reported a result for this commit. This repository-branch PR uses the normal
upstream CI authorization and trigger process; successful cloud execution is
not assumed or claimed.

Latest focused validation: 28 A2A tests and the shared session quota/throttling
shell suite passed, including HTTP 429 service-error retry recovery and bounded
exhaustion. The preceding complete retry fixes passed 109 shared CI Python
tests, 28 locked-SDK runtime tests and both existing shell suites. Formatting,
Bash syntax and whitespace checks passed, with no new Ruff findings versus the
existing baseline. These are local/offline results, not a fresh live Azure E2E run.

The original implementation and historical validation details follow.

Purpose

Add two native A2A Python hosted-agent samples for inclusion in the public sample
repository. This branch starts from upstream main, not from the larger sharing PR.

Sample Purpose
bring-your-own/a2a/echo Deterministic Echo in an actual completed A2A Task; native GetTask examples; no model or Toolbox.
bring-your-own/a2a/travel-planner-web-search Copilot SDK Planner discovers Flight/Hotel Cards and delegates directly over A2A. Specialists consume bounded Toolbox web search; cited trip research is saved in versioned user-isolated storage.

Includes these two samples, their shared behavior fixtures, sample-index links,
and shared CI support needed to validate and run native A2A.
No Support Case sample, synthetic non-web-search travel sample, standalone
bug-bash guide, deployment-specific environment, logs or saved plans.

Architecture

  • Native A2A 1.0 hosts and clients; validate advertised interfaces and trusted
    endpoints before attaching credentials.
  • Travel specialists use Copilot SDK native MCP for Foundry Toolbox web search.
    No Toolbox A2A delegation or direct model HTTP implementation.
  • At most two search attempts per specialist invocation; at least one successful
    cited search is required. Failed/source-less attempts remain in receipts.
  • Request-scoped caller context and W3C trace propagation, including restoration
    across the planner's custom-tool callback boundary.
  • Versioned FoundryStateStore trip requirements, metadata and recommendation
    history; user isolation, 30-day default TTL, ETag/version conflict protection.
    Specialist evidence is bound to the plan ID/version captured before delegation,
    so late results cannot clear a newer revision's pending refresh.
  • Saved research is unverified: no claim of exact-date fares, availability,
    cancellation eligibility, booking or payment.
  • Actual Planner/specialist Task IDs appear in readable output; structured
    operation receipts remain compact.
  • All four runtimes use public PyPI AgentServer A2A 1.0.0b1 and Core 2.3.1b1,
    with genuine per-runtime locks.

Web Search is billed and uses Bing grounding services; the README includes the
data-handling and geographic/compliance-boundary disclosures.

Native A2A CI support

  • Contract validation and planning accept native A2A 1.0 without a skiplist or
    fake Responses declaration.
  • Discovery emits both container and code matrix cells for Echo and Travel.
  • A transport-specific helper sends blocking SendMessage requests through azd,
    using the cell's explicit session and A2A 1.0 wire version. It validates
    JSON-RPC IDs/errors, completed Task state and artifact text, including
    HTTP-200/CLI-exit-zero failures; request, headers and raw evidence are retained.
  • Travel's fixture selects the planner. CI preserves and uniquely names all
    three service/source projects, wires the specialists' own endpoints, and
    uses the existing temporary-toolbox isolation/verification/cleanup lifecycle.
  • Existing Responses approval/continuation and Invocations behavior is preserved.

Validation

  • 111 shared CI/contract/fixture Python regressions passed: 92 hosted-agent
    harness tests, 17 contract-policy tests and 2 published-fixture tests.
  • Both existing session/quota and toolbox-lifecycle shell suites passed.
  • Actual discovery emitted all four expected native-A2A cells: Echo and Travel,
    each with container and code deploy modes.
  • The previously failing contract-policy command validates both new samples.
    Both native-A2A fixture plans build successfully. Ruff, new-file Black
    formatting, Bash syntax and whitespace checks passed.
  • Earlier sample review fixes passed 25 offline regressions with the locked
    public beta SDK runtime, including in-flight stale research rejection.
  • Echo executor was checked for exact Echo: hello, completed Task and explicit
    unsupported cancellation in the public-beta runtime. Runtime dependency policy
    previously passed with --resolve for both samples; no dependency changes
    are introduced by this CI fix.
  • The travel implementation before the review fixes was deployed with public
    betas to the existing test project (Flight/Hotel v2, Planner v3). Six
    execution/storage checks completed while reusing one CLI session. This is
    historical evidence, not a cloud deployment of the new review or CI changes.
  • Offline native runner tests mock azd responses; they do not establish live
    project enablement, model availability, runtime permissions or a fresh cloud
    end-to-end pass. Live cloud execution remains subject to the normal trusted
    pipeline and configured project prerequisites.

Known limitations

Research-quality findings remain: some model prose reduced arrival deadlines to
clock-only comparisons, and clarification offered options unsupported by the
current trip schema. Repeating an unchanged update can also leave a tool failure
recorded even if later research saves succeed. Exact-price booking behavior,
forced restarts and cross-user cloud isolation are not claimed as verified.

Sharing PR is preserved

PR #1126 and feature/a2a-llm-release-planner remain unchanged by these fixes for
users to share and run the bug-bash guide. This PR remains the separate merge proposal.

Hosted Echo public-beta verification

Echo now uses AgentServer A2A 1.0.0b1 and Core 2.3.1b1 from public PyPI in both PRs. A fresh direct-code hosted deployment passed native SendMessage with exactly Echo: hello in a completed Task. GetTask with the same caller/session returned the identical stored Task, including artifacts, history and status; X-Platform-Server confirmed both beta SDK versions. The runtime and lock were verified identical across both branches and the deployment before pushing. Only Echo was redeployed for this check, not Travel. Dependency-policy validation with --resolve passed; 94 shared runner regressions passed. This does not establish the cause of the separately reported deployment's downstream 400 without its session logs, nor claim cross-user isolation or restart recovery.

Include only deterministic Echo and direct A2A travel research with bounded Toolbox web search and versioned user-isolated saved plans. Use public beta SDKs, sample documentation and shared behavior fixtures; exclude the standalone bug-bash guide and Support Case sample.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bind specialist evidence to the plan ID and version captured before delegation. Accept partial cited-search success while preserving bounded attempts and all receipts, and allow additional successful delegations in the cloud fixture. Add offline regressions and document the research binding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Validate native A2A 1.0 contracts and collect checked JSON-RPC Task artifact evidence through the shared runner. Preserve multi-agent deployments with explicit target, specialist endpoint bindings and cell-owned toolbox lifecycle. Add policy, transport, runner and toolbox integration regressions; keep existing Responses and Invocations behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Verify completed Echo artifact and exact saved Task retrieval in a fresh hosted deployment. Separate only recognized azd update notices from raw JSON-RPC evidence; preserve protocol errors and reject unexpected trailing output. Add regressions for the actual CLI output shape.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return failed Tasks without rethrowing, preserve partial planner and failed-specialist receipts, clear recovered specialist failures and align public Agent Cards. Correct service-key cleanup, GitHub init prerequisites and RBAC cache hints. Include sharing-branch backports of partial-search success and version-bound research, with real SDK failed Task send/list/get regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject unsafe Toolbox paths before authentication, allow metadata-only edits of existing pending drafts, preserve stderr retry evidence, manage only CI-owned planner Consumer assignments, and use upstream main sample URLs. Add focused boundary, completion and role lifecycle regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use a deterministic principal/project/role assignment ID and retain CI runtime access across job cleanup. Stable agent identities are shared by concurrent builds, so ephemeral grant cleanup cannot safely revoke their access. Document explicit administrative retirement and test overlapping acquisitions and cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Deploy CI specialists first and bind planner discovery/invocations to their captured versions. Preserve retryable JSON-RPC service errors for retry classification, retain web-search artifacts on failed specialist Tasks, and require matching plan/version saves for every researched plan. Add protocol, deployment, receipt and multi-plan regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Validate each hosted-agent project independently. Route explicit transient failed-Task status diagnostics through bounded retries while preserving terminal failures and per-attempt evidence. Add runner and classifier regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route dependency failures through bounded deployment retries, separate validated A2A diagnostics from answer artifacts, and propagate safe model error codes through specialists and planner receipts. Cover recovery, retry exhaustion, permanent and malformed failures, successful error-like output, and mixed failure causes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Apply bounded throttling retries to failed-Task and JSON-RPC HTTP 429 messages without scanning successful artifacts. Cover recovery, retry exhaustion, and nonmatching prose/status codes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

A successful Flight call for one plan can clear another plan’s unresolved research failure, allowing completion without the failed plan’s research recovering.

1 open issue
What changed in this PR

Adds native A2A examples to the Python hosted-agent samples and extends shared CI to deploy and validate them. This repository-branch replacement for #1144 preserves the earlier review history; reported offline validation does not establish a fresh Travel cloud run.

Changes:

  • Adds deterministic Echo and a three-agent travel planner with bounded web search and versioned, user-isolated research storage.
  • Extends contract validation, discovery, deployment, invocation and bounded retries for native A2A 1.0.
  • Adds deployment guides, request examples, behavior fixtures and regression coverage.
File Description
samples/​python/​hosted-agents/​README.md Links both native A2A samples.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​trip-request.json Provides a public travel-research request.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​toolbox.json Defines the web-search-only toolbox.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​tests/​test_research.py Covers research evidence and version safeguards.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​tests/​test_failures.py Covers failure reporting and retry recovery.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​tools.py Implements request-scoped specialist delegation.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​pyproject.toml Pins planner runtime dependencies.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​plan_store.py Implements versioned trip-storage tools.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​main.py Hosts the planner and emits Task receipts.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​client.py Coordinates the model, specialists and storage.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​agents.py Validates and authenticates specialist discovery.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​.azdignore Excludes local files from packaging.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​travel-agent/​.agentignore Excludes local files from agent uploads.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​hotel-agent/​pyproject.toml Pins hotel runtime dependencies.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​hotel-agent/​main.py Hosts hotel research with failure receipts.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​hotel-agent/​client.py Runs bounded hotel web searches.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​hotel-agent/​.azdignore Excludes local files from packaging.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​hotel-agent/​.agentignore Excludes local files from agent uploads.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​flight-agent/​pyproject.toml Pins flight runtime dependencies.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​flight-agent/​main.py Hosts flight research with failure receipts.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​flight-agent/​client.py Runs bounded flight web searches.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​flight-agent/​.azdignore Excludes local files from packaging.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​src/​flight-agent/​.agentignore Excludes local files from agent uploads.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​README.md Documents deployment, storage and research limitations.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​azure.yaml Configures all three hosted agents.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​AGENTS.md Documents sample maintenance and safety constraints.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​travel-planner-web-search/​.gitignore Excludes generated development files.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​src/​echo-a2a/​pyproject.toml Pins Echo runtime dependencies.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​src/​echo-a2a/​main.py Returns deterministic completed Echo Tasks.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​src/​echo-a2a/​.azdignore Excludes local files from packaging.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​src/​echo-a2a/​.agentignore Excludes local files from agent uploads.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​README.md Documents hosted and local Echo usage.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​get-task.json Provides a native Task-retrieval request.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​echo-request.json Provides a blocking Echo request.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​azure.yaml Configures native A2A Echo deployment.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​AGENTS.md Documents Echo maintenance constraints.
samples/​python/​hosted-agents/​bring-your-own/​a2a/​echo/​.gitignore Excludes generated files and local state.
.github/​scripts/​test/​test_check_hosted_agent_contracts.py Tests A2A contract and version validation.
.github/​scripts/​test/​test_ado_pipeline_fixtures.py Recognizes A2A in published-fixture checks.
.github/​scripts/​hosted_agent_test_spec.py Adds A2A planning and deployment settings.
.github/​scripts/​check_hosted_agent_contracts.py Accepts native A2A 1.0 contracts.
.azure-pipelines/​scripts/​hosted-agents/​tests/​test-hosted-agent-session-quota.sh Tests A2A retry diagnostic classification.
.azure-pipelines/​scripts/​hosted-agents/​tests/​test_hosted_agent_a2a.py Covers A2A preparation, transport and retries.
.azure-pipelines/​scripts/​hosted-agents/​tests/​test_a2a_access.py Tests persistent runtime-access grants.
.azure-pipelines/​scripts/​hosted-agents/​scripts/​prepare_hosted_agent_a2a.py Preserves services and pins specialist deployments.
.azure-pipelines/​scripts/​hosted-agents/​scripts/​invoke_hosted_agent_a2a.py Validates native Tasks and collects evidence.
.azure-pipelines/​scripts/​hosted-agents/​scripts/​hosted-agent-retry.sh Classifies transient and throttling diagnostics.
.azure-pipelines/​scripts/​hosted-agents/​scripts/​hosted_agent_a2a_access.py Ensures persistent planner runtime access.
.azure-pipelines/​scripts/​hosted-agents/​run-hosted-agent.sh Integrates A2A deployment and invocation.
.azure-pipelines/​scripts/​hosted-agents/​discover-samples.sh Discovers native A2A matrix entries.
.azure-pipelines/​hosted-agents-samples-ci.yml Selects A2A for fixture validation.
.azure-pipelines/​hosted-agent-tests/​README.md Documents A2A contracts and CI lifecycle.
.azure-pipelines/​hosted-agent-tests/​python/​bring-your-own/​a2a/​travel-planner-web-search/​test-spec.yml Defines travel research behavior assertions.
.azure-pipelines/​hosted-agent-tests/​python/​bring-your-own/​a2a/​echo/​test-spec.yml Defines the Echo behavior assertion.

Review effort: Balanced

)
result = {"agent": card.name, "task_id": task.id, "answer": answer}
calls.append({"tool": name, **result, **binding})
failures[:] = [failure for failure in failures if failure != name]

This branch was successfully deployed

1 active deployment
L4-validation — 4e60cda7 Deployed Nov 11, 2026 by Hameedkunkanoor via trusted #947
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