Fix GetCallerBaggagePairs: resolve userId across all channels#251
Fix GetCallerBaggagePairs: resolve userId across all channels#251
Conversation
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>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR updates observability hosting caller identity extraction so get_caller_pairs can still populate user.id when aad_object_id is absent, improving telemetry coverage for non-Teams and A2A scenarios.
Changes:
- Changed caller ID resolution in
get_caller_pairsto useaad_object_id -> agentic_user_id -> from.id. - Added regression tests for non-Teams fallback to
from.id. - Added tests for A2A fallback and identifier precedence when multiple values are present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
libraries/microsoft-agents-a365-observability-hosting/microsoft_agents_a365/observability/hosting/scope_helpers/utils.py |
Updates caller user.id derivation used by hosting scope helpers. |
tests/observability/hosting/scope_helpers/test_scope_helper_utils.py |
Adds focused tests for fallback behavior and precedence. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Re: Copilot comment on test_scope_helper_utils.py:106 — The test is correct. In an A2A scenario, |
Summary
aad_object_id, which isNoneon non-Teams channels and A2A callsaad_object_id → agentic_user_id → frm.idChannel behavior after fix
Test plan
🤖 Generated with Claude Code