Add Notification Backend Protocol #24

Merged
A8065384 merged 5 commits from notification-protocol into main 2026-03-09 07:36:48 +00:00
Showing only changes of commit fde32a3a7b - Show all commits

View File

@@ -128,7 +128,9 @@ class FirestoreNotificationBackend:
return result return result
async def mark_as_notified( async def mark_as_notified(
self, phone_number: str, notification_ids: list[str] # noqa: ARG002 self,
phone_number: str, # noqa: ARG002
notification_ids: list[str], # noqa: ARG002
) -> bool: ) -> bool:
"""No-op — the agent is not the delivery mechanism.""" """No-op — the agent is not the delivery mechanism."""
return True return True
@@ -180,9 +182,7 @@ class RedisNotificationBackend:
return [] return []
data = json.loads(raw) data = json.loads(raw)
all_notifications: list[dict[str, Any]] = data.get( all_notifications: list[dict[str, Any]] = data.get("notificaciones", [])
"notificaciones", []
)
if not all_notifications: if not all_notifications:
logger.info( logger.info(
@@ -214,8 +214,7 @@ class RedisNotificationBackend:
result = recent[: self._max_to_notify] result = recent[: self._max_to_notify]
logger.info( logger.info(
"Found %d recent notifications for phone: %s " "Found %d recent notifications for phone: %s (returning top %d)",
"(returning top %d)",
len(recent), len(recent),
phone_number, phone_number,
len(result), len(result),
@@ -231,7 +230,9 @@ class RedisNotificationBackend:
return result return result
async def mark_as_notified( async def mark_as_notified(
self, phone_number: str, notification_ids: list[str] # noqa: ARG002 self,
phone_number: str, # noqa: ARG002
notification_ids: list[str], # noqa: ARG002
) -> bool: ) -> bool:
"""No-op — the agent is not the delivery mechanism.""" """No-op — the agent is not the delivery mechanism."""
return True return True