Commit a10ebc0
Use Activity helpers and ResolveAgentIdentity for agent telemetry (#211)
* Use Activity helper methods and ResolveAgentIdentity for agent telemetry
Replace direct ChannelAccount property access with Activity class helpers
(getAgenticInstanceId, getAgenticUser, getAgenticTenantId) in ScopeUtils
and TurnContextUtils. Use RuntimeUtility.ResolveAgentIdentity for blueprint
ID resolution when authToken is provided, falling back to
recipient.agenticAppBlueprintId. Add authToken parameter with overloaded
signatures (required + deprecated no-arg) for backward compatibility.
Upgrade @microsoft/agents-hosting and agents-activity to ^1.3.1.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix lint errors: extract private Core methods, clean up overload signatures
- Extract deriveAgentDetailsCore and buildInvokeAgentDetailsCore as private
methods so internal callers bypass deprecated overloads (fixes
@typescript-eslint/no-deprecated lint errors)
- Remove `public` from implementation signatures of overloaded methods
(only the two declared overloads should be public-facing)
- Fix stale JSDoc on getTenantIdPair (removed ChannelData reference)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* comments
* Fix agent identity resolution: use ResolveAgentIdentity for agentId, token blueprint claim for agentBlueprintId
- agentId now uses ResolveAgentIdentity (works for both app-based and blueprint agents)
- agentBlueprintId now reads xms_par_app_azp from token for blueprint agents
- Remove deprecated overloads and backward-compat code, authToken is now required
- Consolidate deriveAgentDetailsCore into deriveAgentDetails
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Update CHANGELOG for ScopeUtils breaking changes and Activity helper adoption
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Use optional chaining on Activity helper method calls for resilience
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refactor agent identity resolution and add resolveAuthToken test coverage
- Extract resolveEmbodiedAgentIds() into TurnContextUtils as shared helper
- Align getTargetAgentBaggagePairs with deriveAgentDetails (no agentId for non-agentic)
- Add resolveAuthToken to OutputLoggingMiddleware with per-request/cache dual path
- Export isPerRequestExportEnabled from observability public API
- Fix CHANGELOG to reflect actual agentId resolution behavior
- Add test coverage for resolveAuthToken (per-request, cache, fallback paths)
- Remove unused ResolveAgentIdentity mock from scope-utils tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix A365_AUTH_TOKEN_KEY JSDoc and normalize empty strings in resolveEmbodiedAgentIds
- Correct JSDoc for A365_AUTH_TOKEN_KEY: token is used for embodied/agentic
requests (blueprint ID resolution), not non-agentic requests
- Normalize empty strings to undefined in resolveEmbodiedAgentIds to prevent
noisy telemetry attributes from empty agentId/agentBlueprintId values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: jsl517 <pefan@microsoft.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent ddf4902 commit a10ebc0
13 files changed
Lines changed: 332 additions & 147 deletions
File tree
- packages
- agents-a365-observability-hosting/src
- middleware
- utils
- agents-a365-observability/src
- tests/observability/extension/hosting
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
17 | 31 | | |
18 | 32 | | |
19 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| |||
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
31 | | - | |
| 40 | + | |
| 41 | + | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
| |||
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
50 | 77 | | |
51 | 78 | | |
52 | 79 | | |
| |||
Lines changed: 27 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | | - | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
| 59 | + | |
55 | 60 | | |
56 | | - | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | | - | |
60 | | - | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | | - | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
| 135 | + | |
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
140 | | - | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
| |||
161 | 168 | | |
162 | 169 | | |
163 | 170 | | |
| 171 | + | |
164 | 172 | | |
165 | 173 | | |
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
169 | 177 | | |
170 | 178 | | |
| 179 | + | |
171 | 180 | | |
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
177 | | - | |
| 186 | + | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
| |||
189 | 198 | | |
190 | 199 | | |
191 | 200 | | |
| 201 | + | |
192 | 202 | | |
193 | 203 | | |
194 | | - | |
195 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
196 | 210 | | |
197 | 211 | | |
198 | 212 | | |
| |||
217 | 231 | | |
218 | 232 | | |
219 | 233 | | |
| 234 | + | |
220 | 235 | | |
221 | 236 | | |
222 | 237 | | |
| |||
225 | 240 | | |
226 | 241 | | |
227 | 242 | | |
| 243 | + | |
228 | 244 | | |
229 | 245 | | |
230 | 246 | | |
231 | | - | |
| 247 | + | |
232 | 248 | | |
233 | 249 | | |
234 | 250 | | |
| |||
Lines changed: 27 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
67 | 87 | | |
68 | 88 | | |
69 | 89 | | |
| 90 | + | |
70 | 91 | | |
71 | 92 | | |
72 | | - | |
73 | | - | |
| 93 | + | |
| 94 | + | |
74 | 95 | | |
75 | 96 | | |
76 | | - | |
77 | | - | |
| 97 | + | |
| 98 | + | |
78 | 99 | | |
79 | 100 | | |
80 | 101 | | |
| |||
88 | 109 | | |
89 | 110 | | |
90 | 111 | | |
91 | | - | |
| 112 | + | |
92 | 113 | | |
93 | 114 | | |
94 | 115 | | |
95 | 116 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
0 commit comments