Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,75 @@ async def handle_user_deleted(context, state, notification):
"""
return self.on_lifecycle_notification(AgentLifecycleEvent.USERDELETED, **kwargs)

def on_user_undeleted(
self, **kwargs: Any
) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]:
"""Register a handler for user un-deletion lifecycle events.

This is a convenience decorator that registers a handler specifically for
agentic user identity un-deletion events.

Args:
**kwargs: Additional keyword arguments passed to the app's add_route method.

Returns:
A decorator function that registers the handler with the application.

Example:
```python
@notifications.on_user_undeleted()
async def handle_user_undeleted(context, state, notification):
print("Agentic user identity un-deleted")
```
"""
return self.on_lifecycle_notification(AgentLifecycleEvent.USERUNDELETED, **kwargs)
Comment on lines +449 to +450
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on_user_undeleted returns self.on_lifecycle_notification(...), but AgentNotification doesn’t define an on_lifecycle_notification method anywhere in this module (only on_agent_lifecycle_notification). This will raise AttributeError when the decorator is used. Either implement on_lifecycle_notification (possibly as an alias/wrapper) or update these convenience methods to call the correct existing lifecycle registration method.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not quite sure why this comment was generated, there are existing "on_..." methods that call self.on_lifecycle_notification(...)


def on_user_updated(
self, **kwargs: Any
) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]:
"""Register a handler for user updated lifecycle events.

This is a convenience decorator that registers a handler specifically for
agentic user identity updated events.

Args:
**kwargs: Additional keyword arguments passed to the app's add_route method.

Returns:
A decorator function that registers the handler with the application.

Example:
```python
@notifications.on_user_updated()
async def handle_user_updated(context, state, notification):
print("Agentic user identity updated")
```
"""
return self.on_lifecycle_notification(AgentLifecycleEvent.USERUPDATED, **kwargs)

def on_user_manager_updated(
self, **kwargs: Any
) -> Callable[[AgentHandler], Callable[[TurnContext, TurnState], Awaitable[None]]]:
"""Register a handler for user manager updated lifecycle events.

This is a convenience decorator that registers a handler specifically for
agentic user manager updated events.

Args:
**kwargs: Additional keyword arguments passed to the app's add_route method.

Returns:
A decorator function that registers the handler with the application.

Example:
```python
@notifications.on_user_manager_updated()
async def handle_user_manager_updated(context, state, notification):
print("Agentic user manager updated")
```
"""
return self.on_lifecycle_notification(AgentLifecycleEvent.USERMANAGERUPDATED, **kwargs)

@staticmethod
def _normalize_subchannel(value: str | AgentSubChannel | None) -> str:
"""Normalize a subchannel value to a lowercase string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ class AgentLifecycleEvent(str, Enum):
USERWORKLOADONBOARDINGUPDATED: Event triggered when a user's workload
onboarding status is updated.
USERDELETED: Event triggered when an agentic user identity is deleted.
USERUNDELETED: Event triggered when an agentic user identity is un-deleted.
USERUPDATED: Event triggered when an agentic user identity is updated.
USERMANAGERUPDATED: Event triggered when an agentic user's manager is updated.
"""

USERCREATED = "agenticuseridentitycreated"
USERWORKLOADONBOARDINGUPDATED = "agenticuserworkloadonboardingupdated"
USERDELETED = "agenticuseridentitydeleted"
USERDELETED = "agenticuserdeleted"
USERUNDELETED = "agenticuserundeleted"
Comment on lines 24 to +26
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the string value of the existing AgentLifecycleEvent.USERDELETED enum member from the previous value is a breaking change for consumers who persisted/compared against the old event type. If both event types can still be observed, consider keeping the old value as a deprecated alias/additional enum member (and/or accepting both in routing) to preserve backward compatibility.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not correct in the first place. .NET and NodeJS SDKs have the right value.

USERUPDATED = "agenticuseridentityupdated"
USERMANAGERUPDATED = "agenticusermanagerupdated"
Loading