Add optional TenantId to AgenticIdentity#583
Merged
Merged
Conversation
Expose the agentic tenant id end-to-end: add a typed tenantId to the base ChannelAccount (the wire source), surface it through GetAgenticIdentity and AgenticIdentity.FromAccount, and add AgenticIdentity.TenantId. The duplicate tenantId on TeamsChannelAccount is removed in favor of the inherited base property (same JSON name, no behavior change). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for propagating an optional tenantId from inbound activity accounts into the strongly-typed AgenticIdentity model, aligning teams.net with the wire format and the corresponding teams.py model.
Changes:
- Added optional
TenantIdtoAgenticIdentityand mapped it fromChannelAccount. - Introduced a typed
tenantId(TenantId) property onChannelAccountand wired it intoGetAgenticIdentity(). - Removed duplicate
tenantIdfromTeamsChannelAccount, relying on inheritance, and added unit tests for tenant mapping and the tenant-only non-identity case.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| core/test/Microsoft.Teams.Core.UnitTests/Schema/CoreActivityTests.cs | Adds unit tests for wire tenantId → AgenticIdentity.TenantId mapping and tenant-only behavior. |
| core/src/Microsoft.Teams.Core/Schema/ChannelAccount.cs | Adds typed TenantId (tenantId) on accounts and includes it in GetAgenticIdentity(). |
| core/src/Microsoft.Teams.Core/Schema/AgenticIdentity.cs | Adds optional TenantId and maps it from ChannelAccount. |
| core/src/Microsoft.Teams.Apps/Schema/TeamsChannelAccount.cs | Removes duplicate TenantId property so it’s inherited from ChannelAccount. |
| core/src/Microsoft.Teams.Apps/Diagnostics/TeamsBaggageBuilder.cs | Updates XML doc reference for the tenant fallback comment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MehakBindra
requested changes
Jun 26, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
MehakBindra
approved these changes
Jun 26, 2026
corinagum
approved these changes
Jun 29, 2026
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.
Summary
Adds an optional tenant id to
AgenticIdentity, mirroringtenant_idin teams.py.The tenant arrives on the wire as
tenantIdon the inbound activity's account (alongsideagenticAppId/agenticUserId/agenticAppBlueprintId), so the change wires it through end-to-end.Changes
AgenticIdentity— new optionalTenantIdproperty;FromAccountnow maps it.ChannelAccount— added typedtenantIdJSON property (the wire source);GetAgenticIdentity()now populatesTenantId. AtenantIdalone still does not fabricate an agentic identity.TeamsChannelAccount— removed its duplicatetenantId, now inherited from the baseChannelAccount(same JSON name, no behavior change). Updated the related doc cref inTeamsBaggageBuilder.Verification
tenantIdflowed correctly into the parsedAgenticIdentity.TenantId.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com