Add agentic send helpers#632
Merged
Merged
Conversation
Collaborator
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced Jun 26, 2026
94dbb33 to
089807c
Compare
ad1251d to
f54a6f6
Compare
089807c to
a8f0e2c
Compare
f54a6f6 to
1cf0b6f
Compare
a8f0e2c to
eb8d2e2
Compare
1cf0b6f to
e582bcb
Compare
heyitsaamir
commented
Jun 26, 2026
eb8d2e2 to
c92e38c
Compare
cefad04 to
9088f52
Compare
c92e38c to
b57702e
Compare
9088f52 to
6925d74
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR wires agentic identity and request-level overrides into the @microsoft/teams.apps send/reply pipeline by threading RequestOptions (serviceUrl + agenticIdentity) through App, ActivityContext, and ActivitySender, and adds a new examples/agent365 sample demonstrating reactive + proactive agentic sends.
Changes:
- Extend app-layer
send()/reply()helpers to acceptRequestOptions, and add anApp.getAgenticIdentity()convenience factory. - Refactor
ActivitySenderto reuse a pre-built Teams APIClientand passRequestOptionsinto conversation activity operations. - Add
examples/agent365workspace showing reactive echo and proactive agentic sends.
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/apps/src/types/plugin/sender.ts | Extends IActivitySender with optional agentic identity + RequestOptions support. |
| packages/apps/src/contexts/activity.ts | Simplifies ActivityContext.send() delegation to activitySender. |
| packages/apps/src/app.ts | Adds RequestOptions plumbing to send/reply and introduces getAgenticIdentity(). |
| packages/apps/src/app.spec.ts | Updates tests to pass valid ActivityLike payloads (explicit type). |
| packages/apps/src/app.process.ts | Creates per-turn ApiClient/ActivitySender with agentic identity from inbound recipient. |
| packages/apps/src/app.process.spec.ts | Adjusts serviceUrl capture tests to hook ActivitySender.send. |
| packages/apps/src/activity-sender.ts | Refactors sender to reuse Client and forward RequestOptions into API calls. |
| packages/apps/src/activity-sender.spec.ts | Reworks sender tests to mock the API client instead of raw HTTP. |
| package-lock.json | Adds workspace entries for the new @examples/agent365 package. |
| examples/agent365/turbo.json | Adds turbo task config for building the new example workspace. |
| examples/agent365/tsconfig.json | TypeScript configuration for the new example. |
| examples/agent365/src/proactive.ts | Proactive messaging sample using AgenticIdentity with both app.send and API client. |
| examples/agent365/src/main.ts | Reactive echo sample demonstrating automatic propagation of inbound agentic identity/serviceUrl. |
| examples/agent365/README.md | Documentation for running reactive and proactive samples. |
| examples/agent365/package.json | Declares the new example workspace and scripts. |
| examples/agent365/eslint.config.js | ESLint config for the new example workspace. |
| examples/agent365/appPackage/manifest.json | Teams app manifest for the example agent package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b57702e to
fbf0cbd
Compare
6925d74 to
b8e2b61
Compare
fbf0cbd to
c5dfbda
Compare
b8e2b61 to
80a73f2
Compare
cc09eae to
db6a642
Compare
bff3ee5 to
ef6df69
Compare
db6a642 to
2168311
Compare
ef6df69 to
64922a6
Compare
2168311 to
5188887
Compare
64922a6 to
b2a0d57
Compare
5188887 to
51a9bea
Compare
- AuthProvider.token scope is now optional; provider defaults to cloud scopes - AuthProviderInterceptor accepts defaultAgenticIdentity as fallback - Client (ApiClient) accepts agenticIdentity and passes to interceptor - AppAuthProvider defaults to cloud.botScope / cloud.agenticBotScope Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b2a0d57 to
56bb113
Compare
4cfa97e to
cf3ab03
Compare
corinagum
approved these changes
Jul 7, 2026
Adds foundational token support for Agent 365 scenarios: - `AgenticIdentity` type (agenticAppId, agenticUserId, tenantId, agenticAppBlueprintId) - `agenticBotScope` on `CloudEnvironment` (`https://botapi.skype.com/.default`) - `TokenRequestOptions` type for extensible token callback options - `TokenManager.getAgenticToken(agenticIdentity, scope)` — 3-step FMI token exchange (T1 → T2 → T3) - `TokenManager.getAppToken(scope, tenantId?)` — generalized app token method - `TokenCredentials.token` signature extended: `(scope, tenantId?, options?: TokenRequestOptions)`
Adds support for validating inbound Entra ID tokens (used by Agent 365) alongside existing BotFramework tokens: - `ServiceTokenValidator` now routes tokens based on issuer — Entra vs BotFramework - Decodes unverified JWT payload to inspect `iss` and `tid` claims - Per-tenant Entra `JwtValidator` instances with bounded LRU cache (max 100) - Entra tokens validated against tenant-specific OIDC metadata - Exports `decodeJwtPayload` from `jwt-validator` for pre-validation inspection Note: Does _not_ currently do service url validation (not present in Token)
Adds the auth provider abstraction layer that sits between the app and
the API client:
- `AuthProvider` type — `{ token(options: { scope?, agenticIdentity? })
}`
- `AuthProviderInterceptor` — HTTP interceptor that resolves tokens via
AuthProvider, reads per-request agentic identity from extensions
- `AppAuthProvider` — default implementation backed by `TokenManager`,
handles bot/agentic token routing
- `Client` (ApiClient) constructor extended to accept `cloud`,
`authProvider`, `agenticIdentity`
- HttpClient interceptor interface updated to receive `log` in request
context
- `App.api` wired to use provider-based auth
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add RequestOptions (agenticIdentity, serviceUrl) to app.send() - Add isRequestOptions guard for reply() overload disambiguation - Refactor ActivitySender to accept pre-built API Client - Wire agentic identity from inbound recipient into per-turn sender - Forward serviceUrl from ConversationReference in all API calls - Add getAgenticIdentity() factory on App - Add agenticIdentity to IActivitySender interface - Simplify ActivityContext.send() to delegate to sender directly - Add examples/agent365 reactive + proactive sample Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cf3ab03 to
b8d0118
Compare
927748f to
f206889
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The ActivitySender now uses the API Client (with conversations.activities) rather than raw HTTP client. Update tests to mock the correct interface. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Wires agentic identity into the app-layer send/reply helpers (mirrors Python PR #480):
app.send(conversationId, activity, options?)acceptsRequestOptionsapp.reply()supports options viaisRequestOptionstype guardapp.getAgenticIdentity(appId, userId, opts?)factory methodActivitySenderrefactored to accept pre-builtClient; mergesagenticIdentityandserviceUrlinto all API callsActivitySenderin$processwith identity fromactivity.recipientIActivitySenderinterface extended withreadonly agenticIdentity?ActivityContext.send()simplified — delegates to sender directlyexamples/agent365/— reactive echo + proactive send sample