Skip to content
Closed
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 @@ -7,7 +7,7 @@
from .email_reference import EmailReference
from .wpx_comment import WpxComment

TModel = TypeVar("TModel")
_TModel = TypeVar("_TModel")


class AgentNotificationActivity:
Expand Down Expand Up @@ -148,7 +148,7 @@ def notification_type(self) -> Optional[NotificationTypes]:
return self._notification_type

# Generic escape hatch
def as_model(self, model: Type[TModel]) -> Optional[TModel]:
def as_model(self, model: Type[_TModel]) -> Optional[_TModel]:
Comment on lines 150 to +151
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

as_model calls model.model_validate(...), but the annotation model: Type[_TModel] doesn’t guarantee that the passed type has a model_validate classmethod. Consider bounding _TModel to pydantic.BaseModel (or using type[BaseModel] directly) so static type checkers can validate correct usage.

Copilot uses AI. Check for mistakes.
"""Parse the activity value as a custom model type.

This method provides a generic way to validate and parse the activity's value
Expand Down
Loading