Fix GetCallerBaggagePairs: resolve userId across all channels#246
Merged
Fix GetCallerBaggagePairs: resolve userId across all channels#246
Conversation
…channels GetCallerBaggagePairs previously only used From.AadObjectId for userId (null on email/Word channels) and never set userEmail. Changes: - userId: fallback chain AadObjectId → AgenticUserId → From.Id - userEmail: use From.Id when SubChannel is present (email/Word/SPO) or From.Id matches email format; also check AgenticUserId for A2A calls where the calling agent has an email-based identity Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
- Remove SubChannel check, IsEmail helper, EmailPattern regex, and userEmail field - Keep userId fallback: AadObjectId → AgenticUserId → From.Id - Replace email-specific tests with userId-focused tests covering all fallback paths - Add precedence test: AadObjectId wins when both AadObjectId and AgenticUserId are set - Rename capturedCallerId → capturedUserId in new tests - Use realistic channel names (msteams, outlook) instead of test-channel Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alexlu4250
approved these changes
May 4, 2026
juliomenendez
approved these changes
May 4, 2026
This was referenced May 5, 2026
fpfp100
pushed a commit
to microsoft/Agent365-nodejs
that referenced
this pull request
May 5, 2026
userId was only set from aadObjectId, which is undefined on non-Teams channels and A2A calls. Add fallback chain: aadObjectId → agenticUserId → from.id Port of microsoft/Agent365-dotnet#246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
fpfp100
pushed a commit
to microsoft/Agent365-nodejs
that referenced
this pull request
May 5, 2026
userId was only set from aadObjectId, which is undefined on non-Teams channels and A2A calls. Add fallback chain: aadObjectId → agenticUserId → from.id Port of microsoft/Agent365-dotnet#246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
rads-1996
pushed a commit
to microsoft/opentelemetry-distro-python
that referenced
this pull request
May 5, 2026
* Fix get_caller_pairs: resolve userId across all channels userId was only set from aad_object_id, which is None on non-Teams channels and A2A calls. Add fallback chain: aad_object_id → agentic_user_id → frm.id Port of microsoft/Agent365-dotnet#246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add GUID AgenticUserId test to match .NET PR #246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Peng Fan <pefan@microsoft.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fpfp100
added a commit
to microsoft/opentelemetry-distro-dotnet
that referenced
this pull request
May 5, 2026
* Fix GetCallerBaggagePairs: resolve userId across all channels userId was only set from AadObjectId, which is null on non-Teams channels and A2A calls. Add fallback chain: AadObjectId → AgenticUserId → From.Id Port of microsoft/Agent365-dotnet#246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address Copilot review feedback: clean up misleading comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address review: extract from variable, add GUID test to match .NET PR #246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Peng Fan <pefan@microsoft.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fpfp100
added a commit
to microsoft/Agent365-nodejs
that referenced
this pull request
May 5, 2026
userId was only set from aadObjectId, which is undefined on non-Teams channels and A2A calls. Add fallback chain: aadObjectId → agenticUserId → from.id Port of microsoft/Agent365-dotnet#246 Co-authored-by: Peng Fan <pefan@microsoft.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hectorhdzg
pushed a commit
to microsoft/opentelemetry-distro-javascript
that referenced
this pull request
May 6, 2026
* Fix getCallerBaggagePairs: resolve userId across all channels userId was only set from aadObjectId, which is undefined on non-Teams channels and A2A calls. Add fallback chain: aadObjectId → agenticUserId → from.id Port of microsoft/Agent365-dotnet#246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address review: inline fallback, add GUID test to match .NET PR #246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Format turnContextUtils test file to fix PR build --------- Co-authored-by: Peng Fan <pefan@microsoft.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fpfp100
added a commit
to microsoft/Agent365-python
that referenced
this pull request
May 6, 2026
* Fix GetCallerBaggagePairs: resolve userId across all channels userId was only set from aad_object_id, which is None on non-Teams channels and A2A calls. Add fallback chain: aad_object_id → agentic_user_id → frm.id Port of microsoft/Agent365-dotnet#246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address Copilot review feedback: clean up misleading comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address review: inline fallback, add GUID test to match .NET PR #246 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Peng Fan <pefan@microsoft.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Grant Harris <96964444+gwharris7@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.
Summary
user.id): Previously only set fromFrom.AadObjectId, which isnullon non-Teams channels and A2A calls. Now uses fallback chain:AadObjectId → AgenticUserId → From.IdChannel behavior after fix
userIdAadObjectIdFrom.IdAadObjectIdAgenticUserIduserNameFrom.NameFrom.NameFrom.NameFrom.NameTest plan
userIdfalls back toFrom.IdwhenAadObjectIdis nulluserIdfalls back toAgenticUserIdwhenAadObjectIdis nullAadObjectIdwins when bothAadObjectIdandAgenticUserIdare setAgenticUserId—userIdresolves toAgenticUserId🤖 Generated with Claude Code