Skip to content

Commit f533ad5

Browse files
authored
Merge branch 'main' into dependabot/uv/uv-0.11.6
2 parents 63ab7f5 + 23c9edb commit f533ad5

54 files changed

Lines changed: 3895 additions & 291 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
defaults:
8686
run:
8787
working-directory: ./
88+
env:
89+
PYTHONPATH: ${{ github.workspace }}/versioning/helper
8890

8991
strategy:
9092
matrix:

CLAUDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,18 @@ Place it before imports with one blank line after.
219219
- **Never** use the keyword "Kairo" in code - it's a legacy reference that must be removed/replaced
220220
- If found during code review, flag for removal
221221

222+
### Observability Export Configuration — Coordinated Review Required
223+
224+
The following three constants must stay in sync. If a PR changes **any one** of them, the reviewer (human or Copilot) **must** ask the author to confirm the other two are still correct:
225+
226+
| Constant | Location |
227+
|---|---|
228+
| `PROD_OBSERVABILITY_SCOPE` | `libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/environment_utils.py` |
229+
| `DEFAULT_ENDPOINT_URL` | `libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py` |
230+
| Export URL path pattern | `build_export_url()` in `libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py` |
231+
232+
Snapshot tests in `tests/observability/core/test_export_config_consistency.py` will fail if any value drifts, but the developer must also verify the values are correct for the target environment — the tests only catch accidental drift, not intentional-but-incomplete updates.
233+
222234
### Python Conventions
223235

224236
- Type hints required on all function parameters and return types

libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929
#: notification: The typed notification activity with parsed entities.
3030
#:
3131
#: Example:
32-
#: ```python
33-
#: async def handle_email(
34-
#: context: TurnContext,
35-
#: state: TurnState,
36-
#: notification: AgentNotificationActivity
37-
#: ) -> None:
38-
#: email = notification.email
39-
#: if email:
40-
#: print(f"Processing email: {email.id}")
41-
#: ```
32+
#:
33+
#: .. code-block:: python
34+
#:
35+
#: async def handle_email(
36+
#: context: TurnContext,
37+
#: state: TurnState,
38+
#: notification: AgentNotificationActivity,
39+
#: ) -> None:
40+
#: email = notification.email
41+
#: if email:
42+
#: print(f"Processing email: {email.id}")
4243
AgentHandler = Callable[[TContext, TState, AgentNotificationActivity], Awaitable[None]]
4344

4445

@@ -57,19 +58,19 @@ class AgentNotification:
5758
defaults to all values in the AgentLifecycleEvent enum.
5859
5960
Example:
60-
```python
61-
from microsoft_agents.hosting import Application
62-
from microsoft_agents_a365.notifications import AgentNotification
63-
64-
app = Application()
65-
notifications = AgentNotification(app)
66-
67-
@notifications.on_email()
68-
async def handle_email(context, state, notification):
69-
email = notification.email
70-
if email:
71-
await context.send_activity(f"Received email: {email.id}")
72-
```
61+
.. code-block:: python
62+
63+
from microsoft_agents.hosting import Application
64+
from microsoft_agents_a365.notifications import AgentNotification
65+
66+
app = Application()
67+
notifications = AgentNotification(app)
68+
69+
@notifications.on_email()
70+
async def handle_email(context, state, notification):
71+
email = notification.email
72+
if email:
73+
await context.send_activity(f"Received email: {email.id}")
7374
"""
7475

7576
def __init__(
@@ -126,15 +127,15 @@ def on_agent_notification(
126127
A decorator function that registers the handler with the application.
127128
128129
Example:
129-
```python
130-
from microsoft_agents.activity import ChannelId
130+
.. code-block:: python
131131
132-
@notifications.on_agent_notification(
133-
ChannelId(channel="agents", sub_channel="email")
134-
)
135-
async def handle_custom_channel(context, state, notification):
136-
print(f"Received notification on {notification.channel}/{notification.sub_channel}")
137-
```
132+
from microsoft_agents.activity import ChannelId
133+
134+
@notifications.on_agent_notification(
135+
ChannelId(channel="agents", sub_channel="email")
136+
)
137+
async def handle_custom_channel(context, state, notification):
138+
print(f"Received notification on {notification.channel}/{notification.sub_channel}")
138139
"""
139140
registered_channel = channel_id.channel.lower()
140141
registered_subchannel = (channel_id.sub_channel or "*").lower()
@@ -184,11 +185,11 @@ def on_agent_lifecycle_notification(
184185
A decorator function that registers the handler with the application.
185186
186187
Example:
187-
```python
188-
@notifications.on_agent_lifecycle_notification("agenticuseridentitycreated")
189-
async def handle_user_created(context, state, notification):
190-
print("New user created")
191-
```
188+
.. code-block:: python
189+
190+
@notifications.on_agent_lifecycle_notification("agenticuseridentitycreated")
191+
async def handle_user_created(context, state, notification):
192+
print("New user created")
192193
"""
193194

194195
def route_selector(context: TurnContext) -> bool:
@@ -234,18 +235,17 @@ def on_email(
234235
A decorator function that registers the handler with the application.
235236
236237
Example:
237-
```python
238-
@notifications.on_email()
239-
async def handle_email(context, state, notification):
240-
email = notification.email
241-
if email:
242-
print(f"Received email: {email.id}")
243-
# Send a response
244-
response = EmailResponse.create_email_response_activity(
245-
"<p>Thank you for your email.</p>"
246-
)
247-
await context.send_activity(response)
248-
```
238+
.. code-block:: python
239+
240+
@notifications.on_email()
241+
async def handle_email(context, state, notification):
242+
email = notification.email
243+
if email:
244+
print(f"Received email: {email.id}")
245+
response = EmailResponse.create_email_response_activity(
246+
"<p>Thank you for your email.</p>"
247+
)
248+
await context.send_activity(response)
249249
"""
250250
return self.on_agent_notification(
251251
ChannelId(channel="agents", sub_channel=AgentSubChannel.EMAIL), **kwargs
@@ -266,13 +266,13 @@ def on_word(
266266
A decorator function that registers the handler with the application.
267267
268268
Example:
269-
```python
270-
@notifications.on_word()
271-
async def handle_word_comment(context, state, notification):
272-
comment = notification.wpx_comment
273-
if comment:
274-
print(f"Received Word comment: {comment.comment_id}")
275-
```
269+
.. code-block:: python
270+
271+
@notifications.on_word()
272+
async def handle_word_comment(context, state, notification):
273+
comment = notification.wpx_comment
274+
if comment:
275+
print(f"Received Word comment: {comment.comment_id}")
276276
"""
277277
return self.on_agent_notification(
278278
ChannelId(channel="agents", sub_channel=AgentSubChannel.WORD), **kwargs
@@ -293,13 +293,13 @@ def on_excel(
293293
A decorator function that registers the handler with the application.
294294
295295
Example:
296-
```python
297-
@notifications.on_excel()
298-
async def handle_excel_comment(context, state, notification):
299-
comment = notification.wpx_comment
300-
if comment:
301-
print(f"Received Excel comment: {comment.comment_id}")
302-
```
296+
.. code-block:: python
297+
298+
@notifications.on_excel()
299+
async def handle_excel_comment(context, state, notification):
300+
comment = notification.wpx_comment
301+
if comment:
302+
print(f"Received Excel comment: {comment.comment_id}")
303303
"""
304304
return self.on_agent_notification(
305305
ChannelId(channel="agents", sub_channel=AgentSubChannel.EXCEL), **kwargs
@@ -320,13 +320,13 @@ def on_powerpoint(
320320
A decorator function that registers the handler with the application.
321321
322322
Example:
323-
```python
324-
@notifications.on_powerpoint()
325-
async def handle_powerpoint_comment(context, state, notification):
326-
comment = notification.wpx_comment
327-
if comment:
328-
print(f"Received PowerPoint comment: {comment.comment_id}")
329-
```
323+
.. code-block:: python
324+
325+
@notifications.on_powerpoint()
326+
async def handle_powerpoint_comment(context, state, notification):
327+
comment = notification.wpx_comment
328+
if comment:
329+
print(f"Received PowerPoint comment: {comment.comment_id}")
330330
"""
331331
return self.on_agent_notification(
332332
ChannelId(channel="agents", sub_channel=AgentSubChannel.POWERPOINT), **kwargs
@@ -347,11 +347,11 @@ def on_lifecycle(
347347
A decorator function that registers the handler with the application.
348348
349349
Example:
350-
```python
351-
@notifications.on_lifecycle()
352-
async def handle_any_lifecycle_event(context, state, notification):
353-
print(f"Lifecycle event type: {notification.notification_type}")
354-
```
350+
.. code-block:: python
351+
352+
@notifications.on_lifecycle()
353+
async def handle_any_lifecycle_event(context, state, notification):
354+
print(f"Lifecycle event type: {notification.notification_type}")
355355
"""
356356
return self.on_lifecycle_notification("*", **kwargs)
357357

@@ -370,11 +370,11 @@ def on_user_created(
370370
A decorator function that registers the handler with the application.
371371
372372
Example:
373-
```python
374-
@notifications.on_user_created()
375-
async def handle_user_created(context, state, notification):
376-
print("New agentic user identity created")
377-
```
373+
.. code-block:: python
374+
375+
@notifications.on_user_created()
376+
async def handle_user_created(context, state, notification):
377+
print("New agentic user identity created")
378378
"""
379379
return self.on_lifecycle_notification(AgentLifecycleEvent.USERCREATED, **kwargs)
380380

@@ -393,11 +393,11 @@ def on_user_workload_onboarding(
393393
A decorator function that registers the handler with the application.
394394
395395
Example:
396-
```python
397-
@notifications.on_user_workload_onboarding()
398-
async def handle_onboarding_update(context, state, notification):
399-
print("User workload onboarding status updated")
400-
```
396+
.. code-block:: python
397+
398+
@notifications.on_user_workload_onboarding()
399+
async def handle_onboarding_update(context, state, notification):
400+
print("User workload onboarding status updated")
401401
"""
402402
return self.on_lifecycle_notification(
403403
AgentLifecycleEvent.USERWORKLOADONBOARDINGUPDATED, **kwargs
@@ -418,11 +418,11 @@ def on_user_deleted(
418418
A decorator function that registers the handler with the application.
419419
420420
Example:
421-
```python
422-
@notifications.on_user_deleted()
423-
async def handle_user_deleted(context, state, notification):
424-
print("Agentic user identity deleted")
425-
```
421+
.. code-block:: python
422+
423+
@notifications.on_user_deleted()
424+
async def handle_user_deleted(context, state, notification):
425+
print("Agentic user identity deleted")
426426
"""
427427
return self.on_lifecycle_notification(AgentLifecycleEvent.USERDELETED, **kwargs)
428428

libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ class AgentNotificationActivity:
2828
activity: The underlying Activity object.
2929
3030
Example:
31-
```python
32-
async def email_handler(context: TurnContext, state: TurnState, notification: AgentNotificationActivity):
33-
email = notification.email
34-
if email:
35-
print(f"Received email: {email.id}")
36-
print(f"Body: {email.html_body}")
37-
```
31+
.. code-block:: python
32+
33+
async def email_handler(
34+
context: TurnContext,
35+
state: TurnState,
36+
notification: AgentNotificationActivity,
37+
) -> None:
38+
email = notification.email
39+
if email:
40+
print(f"Received email: {email.id}")
41+
print(f"Body: {email.html_body}")
3842
"""
3943

4044
def __init__(self, activity: Activity):
@@ -158,17 +162,17 @@ def as_model(self, model: Type[TModel]) -> Optional[TModel]:
158162
An instance of the specified model type if validation succeeds, otherwise None.
159163
160164
Example:
161-
```python
162-
from pydantic import BaseModel
165+
.. code-block:: python
163166
164-
class CustomNotification(BaseModel):
165-
custom_field: str
167+
from pydantic import BaseModel
166168
167-
notification = AgentNotificationActivity(activity)
168-
custom = notification.as_model(CustomNotification)
169-
if custom:
170-
print(custom.custom_field)
171-
```
169+
class CustomNotification(BaseModel):
170+
custom_field: str
171+
172+
notification = AgentNotificationActivity(activity)
173+
custom = notification.as_model(CustomNotification)
174+
if custom:
175+
print(custom.custom_field)
172176
"""
173177
try:
174178
return model.model_validate(self.value or {})

libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/email_response.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ def create_email_response_activity(email_response_html_body: str) -> Activity:
3636
entity attached to its entities list.
3737
3838
Example:
39-
```python
40-
activity = EmailResponse.create_email_response_activity(
41-
"<p>Thank you for your email. I'll get back to you soon.</p>"
42-
)
43-
await context.send_activity(activity)
44-
```
39+
.. code-block:: python
40+
41+
activity = EmailResponse.create_email_response_activity(
42+
"<p>Thank you for your email. I'll get back to you soon.</p>"
43+
)
44+
await context.send_activity(activity)
4545
"""
4646
working_activity = Activity(type="message")
4747
email_response = EmailResponse(html_body=email_response_html_body)

libraries/microsoft-agents-a365-notifications/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[build-system]
22
requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"]
33
build-backend = "build_backend"
4-
backend-path = ["../../versioning/helper"]
54

65
[project]
76
name = "microsoft-agents-a365-notifications"

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def _configure_internal(
180180
token_resolver=exporter_options.token_resolver,
181181
cluster_category=exporter_options.cluster_category,
182182
use_s2s_endpoint=exporter_options.use_s2s_endpoint,
183+
max_payload_bytes=exporter_options.max_payload_bytes,
183184
)
184185

185186
else:

0 commit comments

Comments
 (0)