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