Fix getCallerBaggagePairs: resolve userId across all channels#116
Merged
Conversation
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>
fpfp100
requested review from
JacksonWeber,
MSNev,
hectorhdzg,
jeremydvoss,
lzchen and
rads-1996
as code owners
May 5, 2026 00:54
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates A365 hosting baggage extraction so user.id can be resolved across non-Teams channels and agent-to-agent (A2A) calls by adding a fallback chain for caller identity, and adds unit tests to validate the new behavior.
Changes:
- Update
getCallerBaggagePairs()to resolveuser.idviaaadObjectId → agenticUserId → from.id. - Extend the minimal hosting
ActivityLike.fromtype to include an optionalid. - Add unit tests covering non-Teams fallback, A2A fallback, and precedence when multiple identifiers are present.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/internal/unit/a365/hosting/turnContextUtils.test.ts | Adds test coverage for new user.id fallback and precedence behavior. |
| src/a365/hosting/types.ts | Extends ActivityLike.from with an optional id field for structural compatibility with non-Teams activities. |
| src/a365/hosting/turnContextUtils.ts | Implements the userId fallback chain used to populate OpenTelemetry baggage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
juliomenendez
approved these changes
May 5, 2026
hectorhdzg
approved these changes
May 5, 2026
Member
|
@fpfp100 can you fix format/lint issues? we should be able to merge after that |
JacksonWeber
approved these changes
May 5, 2026
hectorhdzg
approved these changes
May 6, 2026
2 tasks
hectorhdzg
pushed a commit
that referenced
this pull request
May 13, 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
aadObjectId, which isundefinedon non-Teams channels and A2A callsaadObjectId → agenticUserId → from.ididfield toActivityLike.fromtype definitionChannel behavior after fix
Test plan
🤖 Generated with Claude Code