The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(gateway/platforms): group D minor layout packs
Tekniumc4a6970d8706
diff --git a/gateway/platforms/msgraph_webhook.py b/gateway/platforms/msgraph_webhook.pyindex 4ebf8c9f687..7b4bfdc7e13 100644--- a/gateway/platforms/msgraph_webhook.py+++ b/gateway/platforms/msgraph_webhook.py@@ -177,11 +177,8 @@ class MSGraphWebhookAdapter(BasePlatformAdapter):if not self._source_ip_allowed(request):return web.Response(status=403)return web.json_response({- "status": "ok",- "platform": self.platform.value,- "webhook_path": self._webhook_path,- "accepted": self._accepted_count,- "duplicates": self._duplicate_count})+ "status": "ok", "platform": self.platform.value, "webhook_path": self._webhook_path,+ "accepted": self._accepted_count, "duplicates": self._duplicate_count})async def _handle_validation(self, request: "web.Request") -> "web.Response":"""Graph subscription validation handshake: echo ``validationToken`` verbatim@@ -319,8 +316,7 @@ class MSGraphWebhookAdapter(BasePlatformAdapter):template = self.config.extra.get("prompt", "")if template:return _render_template(template, {- "notification": notification,- "resource": notification.get("resource", ""),+ "notification": notification, "resource": notification.get("resource", ""),"change_type": notification.get("changeType", ""),"subscription_id": notification.get("subscriptionId", "")})rendered = json.dumps(notification, indent=2, sort_keys=True)[:4000]diff --git a/gateway/platforms/signal.py b/gateway/platforms/signal.pyindex 711c5cac495..05f58e6b404 100644--- a/gateway/platforms/signal.py+++ b/gateway/platforms/signal.py@@ -312,9 +312,8 @@ class SignalAdapter(BasePlatformAdapter):while self._running:try:logger.debug("Signal SSE: connecting to %s", url)- async with self.client.stream(- "GET", url, headers={"Accept": "text/event-stream"}, timeout=None,- ) as response:+ headers = {"Accept": "text/event-stream"}+ async with self.client.stream("GET", url, headers=headers, timeout=None) as response:self._sse_response = responsebackoff = SSE_RETRY_DELAY_INITIAL # Reset on successful connectionself._last_sse_activity = time.time()@@ -491,8 +490,7 @@ class SignalAdapter(BasePlatformAdapter):chat_id=chat_id, chat_name=group_info.get("groupName") if group_info else sender_name,chat_type="group" if is_group else "dm", user_id=sender,user_name=sender_name or sender, user_id_alt=sender_uuid if sender_uuid else None,- chat_id_alt=group_id if is_group else None,- )+ chat_id_alt=group_id if is_group else None)# First matching MIME prefix wins; everything else (application/*, text/*, unknown)# is a DOCUMENT so run.py's document-context injection surfaces the cached path.msg_type = MessageType.TEXT if not media_types else next(diff --git a/gateway/platforms/signal_rate_limit.py b/gateway/platforms/signal_rate_limit.pyindex 860fdb8331d..202b393d941 100644--- a/gateway/platforms/signal_rate_limit.py+++ b/gateway/platforms/signal_rate_limit.py@@ -107,8 +107,7 @@ class SignalAttachmentScheduler:``acquire(n)`` calls serialize through an ``asyncio.Lock`` — FIFO across sessions."""def __init__(- self,- capacity: float = float(SIGNAL_RATE_LIMIT_BUCKET_CAPACITY),+ self, capacity: float = float(SIGNAL_RATE_LIMIT_BUCKET_CAPACITY),default_retry_after: float = float(SIGNAL_RATE_LIMIT_DEFAULT_RETRY_AFTER)) -> None:self.capacity = float(capacity)self.tokens = float(capacity)diff --git a/gateway/platforms/webhook.py b/gateway/platforms/webhook.pyindex 6f55c21f042..b7e710bf358 100644--- a/gateway/platforms/webhook.py+++ b/gateway/platforms/webhook.py@@ -46,10 +46,9 @@ _PROFILE_REJECTED = object()_UNPARSEABLE = object()_BUILTIN_DELIVER_PLATFORMS = {- "telegram", "discord", "slack", "signal", "sms", "whatsapp",- "matrix", "mattermost", "homeassistant", "email", "dingtalk",- "feishu", "wecom", "wecom_callback", "weixin", "bluebubbles",- "qqbot", "yuanbao"}+ "telegram", "discord", "slack", "signal", "sms", "whatsapp", "matrix", "mattermost",+ "homeassistant", "email", "dingtalk", "feishu", "wecom", "wecom_callback", "weixin",+ "bluebubbles", "qqbot", "yuanbao"}# ``None`` → aiohttp binds BOTH address families. "0.0.0.0" is IPv4-only and was# unreachable on IPv6-only networks (Fly.io 6PN); "::" becomes IPv6-only where the