Skip to content

A2A Sample#584

Merged
MehakBindra merged 2 commits into
mainfrom
mehak/a2a
May 20, 2026
Merged

A2A Sample#584
MehakBindra merged 2 commits into
mainfrom
mehak/a2a

Conversation

@MehakBindra
Copy link
Copy Markdown
Contributor

This pull request refactors and improves the a2a Teams bot sample to support a symmetric "Alice and Bob" handoff scenario, where two bots can hand users off to each other using the A2A protocol. The changes introduce per-bot configuration, update dependencies, add clear documentation, and implement robust A2A client/server logic for proactive handoffs.

Key changes include:

New features and architecture

  • Added support for two symmetric bots ("Alice" and "Bob") with separate .env templates, configuration, and scripts. Each bot can listen on its own port and hand off to the other. (.env.alice.template, .env.bob.template, package.json, README.md) [1] [2] [3] [4]
  • Implemented an outbound A2A client (A2APeerClient in src/a2a-client.ts) that resolves the peer's live AgentCard and sends handoff messages as DataParts.
  • Implemented an inbound A2A server executor (HandoffAgentExecutor in src/a2a-server.ts) that receives handoffs, opens a proactive 1:1 DM with the user, seeds conversation history, and sends a greeting using the LLM.

Configuration and scripts

  • Added .env.alice and .env.bob to .gitignore for local, per-bot configuration.
  • Updated package.json scripts for per-bot development (dev:alice, dev:bob) and switched to a unified entrypoint. Updated and added dependencies for the new architecture.
  • Reset the package version to 0.0.1 for the new sample structure.

Documentation

  • Overhauled README.md to clearly explain the dual-bot handoff scenario, configuration steps, flow, caveats, and how to run the sample.

Cleanup

  • Removed the old CHANGELOG.md as part of the sample reset.

Overall, these changes provide a clear, modern, and easily configurable sample for demonstrating proactive A2A handoffs between two Teams bots.

Copy link
Copy Markdown
Contributor

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

Note

Copilot was unable to run its full agentic suite in this review.

Refactors the A2A Teams bot sample into a symmetric “Alice ↔ Bob” proactive handoff scenario using @a2a-js/sdk, with per-bot configuration and updated docs/scripts.

Changes:

  • Replaced the previous client/server examples with a unified Express + teams.ts entrypoint implementing real A2A client/server handoff flow.
  • Added per-bot config + env templates (Alice/Bob), updated scripts/deps, and expanded documentation for the dual-bot setup.
  • Removed the old changelog and simplified the turborepo build dependencies for this example.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
examples/a2a/turbo.json Simplifies build dependency graph for the example.
examples/a2a/src/types.ts Adds shared types for bot config, turn identity, and handoff payload + AgentCard builder.
examples/a2a/src/index.ts New unified entrypoint: Express + teams.ts + A2A endpoints + message loop wiring.
examples/a2a/src/agent.ts Implements LLM agent with per-conversation history and handoff_to_peer tool using A2A.
examples/a2a/src/a2a-server.ts Implements inbound A2A executor that opens a proactive 1:1 DM and greets with context.
examples/a2a/src/a2a-client.ts Implements outbound A2A peer resolution + sending handoff payload as a DataPart.
examples/a2a/package.json Updates scripts/deps for dual-bot dev workflow; resets version.
examples/a2a/README.md Overhauls documentation for the new symmetric proactive handoff sample.
examples/a2a/.gitignore Ignores per-bot .env files.
examples/a2a/.env.alice.template Adds Alice env template.
examples/a2a/.env.bob.template Adds Bob env template.
examples/a2a/src/server-example.ts Removes old server example implementation.
examples/a2a/src/client-example.ts Removes old client example implementation.
examples/a2a/CHANGELOG.md Removes old changelog as part of sample reset.

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

Comment thread examples/a2a/src/a2a-server.ts
Comment thread examples/a2a/src/index.ts
Comment thread examples/a2a/src/agent.ts
Comment thread examples/a2a/package.json
Comment thread examples/a2a/src/a2a-server.ts
Comment thread examples/a2a/src/index.ts Outdated
Comment thread examples/a2a/src/index.ts
Comment thread examples/a2a/README.md Outdated
Comment thread examples/a2a/src/a2a-server.ts
Copy link
Copy Markdown
Collaborator

@corinagum corinagum left a comment

Choose a reason for hiding this comment

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

LGTM! I left a few comments and nits; your call on final decison for them. LMK happy to re-stamp when you're ready.

👍🏼

@MehakBindra MehakBindra merged commit d0d8624 into main May 20, 2026
8 checks passed
@MehakBindra MehakBindra deleted the mehak/a2a branch May 20, 2026 23:04
corinagum added a commit that referenced this pull request May 27, 2026
## Summary

Brings `origin/main` into `release` for the **2.0.12** release. **No
carve-outs this time** — Quoted Replies is included.

`version.json`: `2.0.12-preview.{height}` → `2.0.12`.

Aligns with teams.py 2.0.12 (PR #442 already on PyPI / pending publish).

## What's in this release (delta from 2.0.11)

**Features**
- Quoted Replies + new quotes features — previously held back via the
2.0.11 carve-out (#576)
- SuggestedActionSubmitActivity for `suggestedAction/submit` invoke
(#591)
- Default targeted replies for targeted inbound messages (#592)
- Filter colliding keys before `Object.assign` in `ActivityContext`
(#596)
- Prompt Preview support (#536)
- A2A sample (#584)
- AI/MCPClient (#572)
- Allow passing custom HTTP client via `AppOptions`-equivalent
- Reactions API marked GA (#575), Rename `ReactionClient.remove()` →
`delete()` (#567)

**Security & fixes**
- Security hardening: tighten cross-origin policies (#595)
- Lock JsonWebToken trust-boundary contract (#586)
- `fix(deps)`: npm audit fix — clears all high-severity advisories
(#599)
- `fix(apps)`: log inbound activities at info, warn on missing
Authorization (#568)
- `fix`: App user-agent merging (#573)
- `fix`: Add null checks in `local-memory.ts` to prevent role crash
(#438)
- `fix`: `@microsoft/teams.client` import error in webpack 5 (#566)
- Switch to named imports without subpaths (#561)

**Deprecations / package changes**
- Deprecate `DevtoolsPlugin` in favor of Microsoft 365 Agents Playground
(#593)
- Remove in-repo Teams CLI package (#580) — moved to
`teams-sdk/packages/cli`
- Deprecate AI Libraries (#588)
- Correct imports + return types in misc. packages (#589)

**Dependency bumps**
- turbo 2.8.11 → 2.9.14 (#587)
- qs 6.15.0 → 6.15.2 (#594)
- hono 4.12.14 → 4.12.16 (#562)
- npm audit fix bundle (#599): axios 1.13.5 → 1.16.1, fast-uri 3.1.0 →
3.1.2, ws 8.19.0 → 8.21.0, @azure/msal-node hoisted 5.2.2, uuid 11.1.0 →
11.1.1, @azure/identity 4.13.0 → 4.13.1, express-rate-limit, ip-address,
brace-expansion, etc.

## Quoted Replies inclusion notes

- Teams client rendering is in-sync with the wire format as of
2026-05-06.
- APX QR rollout completed: Public 2026-04-10, GCCH/DoD/Gallatin
2026-04-14.
- No SDK-side carve-outs needed; this matches the teams.py 2.0.12 (PR
#442) decision.

## Branch structure note

`prep-release/2.0.12` is reset to `origin/main` + a one-line
`version.json` bump. Diff against `release` (this PR) shows the full
delta from 2.0.11. We deliberately did not use a 2-parent merge commit —
the auto-merge tried to interleave non-overlapping hunks from main's QR
additions with release's QR carve-outs in `activity.ts`, producing a
semantically broken file. Reset-to-main + version bump is the clean way
to express "release should equal main."

## Test plan

- [x] `npm install` clean (post-audit-fix lockfile)
- [x] `npm run build` — 33/33 targets clean
- [x] `npm test` — 14/14 task targets, 279+ tests pass
- [x] E2E echo bot smoke test against `cg-test-bot-py` via canary ABS —
done on `cg/audit-deps-ts` (now merged); covers axios + msal-node code
paths
- [ ] Pipeline Build + Test stages green on `release` after merge
- [ ] Publish pipeline run with **Public** → ESRP → npm
`@microsoft/teams.*@2.0.12`
- [ ] Smoke install: `npm view @microsoft/teams.apps@2.0.12` after
publish
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