refactor: remove verified unused internals (#6460)

* refactor: remove verified unused internals

* test(linear): synchronize webhook shutdown with writer join
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-26 21:45:36 +08:00
1 parent 3230013963
commit f23a6d1485
105 files changed
+207 -1282

No files matched your search

@@ -26,7 +26,6 @@ RATE_LIMITS = {
"updates": 15,
"media": 12,
}
_RATE_WINDOW_SECONDS = 60.0
# error.code values that carry a specific recovery contract.
CODE_INVALID_TOKEN = 100
@@ -73,7 +73,6 @@ _RATE_WINDOW_SECONDS = 60.0
# 15 polls/minute is one per 4s even when traffic is continuous.
_MIN_POLL_GAP_SECONDS = 4.1
_MAX_POLL_LIMIT = 100
_DEFAULT_POLL_LIMIT = 50
# The typing indicator expires after 25s, so refresh inside that window.
_TYPING_REFRESH_SECONDS = 20.0
@@ -94,10 +94,6 @@ def _text_message(wamid: str, body: str = "hi", sender: str = "user:55") -> dict
}
def _json_response(status: int, payload: Any) -> httpx.Response:
return httpx.Response(status, json=payload)
# ----------------------------------------------------------------------
# Retry policy
# ----------------------------------------------------------------------
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "Open agent setup guide",
"officialLabel": "Open WhatsApp agent help",
"summary": "Connect nanobot through WhatsApp's Agent Platform API. Only you can chat with it, and it cannot access your other WhatsApp chats.",
"privacyNotice": "Agent chats are not end-to-end encrypted. Messages are processed by nanobot and your configured model provider.",
"fields": {
"token": {
"label": "API token",
"placeholder": "In WhatsApp, open Settings → Agents, create the agent, then copy the key from the agent chat → Chat info → API key.",
"help": "In WhatsApp, open Settings → Agents, create the agent, then copy the key from the agent chat → Chat info → API key."
"placeholder": "In WhatsApp, open Settings → Agents, create the agent, then copy the key from the agent chat → Chat info → API key."
},
"allowFrom": {
"label": "Allowed senders",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "Abrir la guía de configuración del agente",
"officialLabel": "Abrir la ayuda de agentes de WhatsApp",
"summary": "Conecta nanobot mediante la API de WhatsApp Agent Platform. Solo tú puedes chatear con él y no puede acceder a tus otros chats de WhatsApp.",
"privacyNotice": "Los chats con el agente no están cifrados de extremo a extremo. nanobot y el proveedor de modelos que hayas configurado procesan los mensajes.",
"fields": {
"token": {
"label": "Token de API",
"placeholder": "En WhatsApp, abre Ajustes → Agentes, crea el agente y copia la clave desde el chat del agente → Info del chat → Clave de API.",
"help": "En WhatsApp, abre Ajustes → Agentes, crea el agente y copia la clave desde el chat del agente → Info del chat → Clave de API."
"placeholder": "En WhatsApp, abre Ajustes → Agentes, crea el agente y copia la clave desde el chat del agente → Info del chat → Clave de API."
},
"allowFrom": {
"label": "Remitentes permitidos",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "Ouvrir le guide de configuration de l'agent",
"officialLabel": "Ouvrir l'aide des agents WhatsApp",
"summary": "Connectez nanobot via l'API WhatsApp Agent Platform. Vous seul pouvez lui écrire, et il ne peut pas accéder à vos autres conversations WhatsApp.",
"privacyNotice": "Les conversations avec l'agent ne sont pas chiffrées de bout en bout. Les messages sont traités par nanobot et le fournisseur de modèles que vous avez configuré.",
"fields": {
"token": {
"label": "Jeton d'API",
"placeholder": "Dans WhatsApp, ouvrez Réglages → Agents, créez l'agent, puis copiez la clé depuis la conversation de l'agent → Infos de la discussion → Clé API.",
"help": "Dans WhatsApp, ouvrez Réglages → Agents, créez l'agent, puis copiez la clé depuis la conversation de l'agent → Infos de la discussion → Clé API."
"placeholder": "Dans WhatsApp, ouvrez Réglages → Agents, créez l'agent, puis copiez la clé depuis la conversation de l'agent → Infos de la discussion → Clé API."
},
"allowFrom": {
"label": "Expéditeurs autorisés",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "Buka panduan penyiapan agen",
"officialLabel": "Buka bantuan agen WhatsApp",
"summary": "Hubungkan nanobot melalui API WhatsApp Agent Platform. Hanya Anda yang dapat mengobrol dengannya, dan agen tidak dapat mengakses obrolan WhatsApp Anda yang lain.",
"privacyNotice": "Obrolan dengan agen tidak dienkripsi secara menyeluruh. Pesan diproses oleh nanobot dan penyedia model yang Anda konfigurasikan.",
"fields": {
"token": {
"label": "Token API",
"placeholder": "Di WhatsApp, buka Setelan → Agen, buat agen, lalu salin kunci dari obrolan agen → Info obrolan → Kunci API.",
"help": "Di WhatsApp, buka Setelan → Agen, buat agen, lalu salin kunci dari obrolan agen → Info obrolan → Kunci API."
"placeholder": "Di WhatsApp, buka Setelan → Agen, buat agen, lalu salin kunci dari obrolan agen → Info obrolan → Kunci API."
},
"allowFrom": {
"label": "Pengirim yang diizinkan",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "エージェント設定ガイドを開く",
"officialLabel": "WhatsApp エージェントのヘルプを開く",
"summary": "WhatsApp Agent Platform API を通じて nanobot を接続します。会話できるのは本人だけで、他の WhatsApp チャットにはアクセスできません。",
"privacyNotice": "エージェントとのチャットはエンドツーエンド暗号化されません。メッセージは nanobot と設定したモデルプロバイダーによって処理されます。",
"fields": {
"token": {
"label": "API トークン",
"placeholder": "WhatsApp で 設定 → エージェント を開き、エージェントを作成して、エージェントのチャット → チャット情報 → API キー からキーをコピーします。",
"help": "WhatsApp で 設定 → エージェント を開き、エージェントを作成して、エージェントのチャット → チャット情報 → API キー からキーをコピーします。"
"placeholder": "WhatsApp で 設定 → エージェント を開き、エージェントを作成して、エージェントのチャット → チャット情報 → API キー からキーをコピーします。"
},
"allowFrom": {
"label": "許可する送信者",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "에이전트 설정 가이드 열기",
"officialLabel": "WhatsApp 에이전트 도움말 열기",
"summary": "WhatsApp Agent Platform API를 통해 nanobot을 연결합니다. 나만 대화할 수 있으며 다른 WhatsApp 채팅에는 접근할 수 없습니다.",
"privacyNotice": "에이전트와의 채팅에는 종단간 암호화가 적용되지 않습니다. 메시지는 nanobot과 설정한 모델 제공업체가 처리합니다.",
"fields": {
"token": {
"label": "API 토큰",
"placeholder": "WhatsApp에서 설정 → 에이전트를 열고 에이전트를 만든 뒤 에이전트 채팅 → 채팅 정보 → API 키에서 키를 복사하세요.",
"help": "WhatsApp에서 설정 → 에이전트를 열고 에이전트를 만든 뒤 에이전트 채팅 → 채팅 정보 → API 키에서 키를 복사하세요."
"placeholder": "WhatsApp에서 설정 → 에이전트를 열고 에이전트를 만든 뒤 에이전트 채팅 → 채팅 정보 → API 키에서 키를 복사하세요."
},
"allowFrom": {
"label": "허용된 발신자",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "Abrir o guia de configuração do agente",
"officialLabel": "Abrir a ajuda de agentes do WhatsApp",
"summary": "Conecte o nanobot pela API do WhatsApp Agent Platform. Só você pode conversar com ele, e ele não pode acessar suas outras conversas do WhatsApp.",
"privacyNotice": "As conversas com o agente não têm criptografia de ponta a ponta. As mensagens são processadas pelo nanobot e pelo provedor de modelos que você configurou.",
"fields": {
"token": {
"label": "Token de API",
"placeholder": "No WhatsApp, abra Configurações → Agentes, crie o agente e copie a chave em conversa do agente → Informações da conversa → Chave de API.",
"help": "No WhatsApp, abra Configurações → Agentes, crie o agente e copie a chave em conversa do agente → Informações da conversa → Chave de API."
"placeholder": "No WhatsApp, abra Configurações → Agentes, crie o agente e copie a chave em conversa do agente → Informações da conversa → Chave de API."
},
"allowFrom": {
"label": "Remetentes permitidos",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "Mở hướng dẫn thiết lập tác nhân",
"officialLabel": "Mở trợ giúp tác nhân WhatsApp",
"summary": "Kết nối nanobot qua API WhatsApp Agent Platform. Chỉ bạn có thể trò chuyện với tác nhân và tác nhân không thể truy cập các cuộc trò chuyện WhatsApp khác của bạn.",
"privacyNotice": "Cuộc trò chuyện với tác nhân không được mã hóa đầu cuối. Tin nhắn được xử lý bởi nanobot và nhà cung cấp mô hình bạn đã cấu hình.",
"fields": {
"token": {
"label": "Mã thông báo API",
"placeholder": "Trong WhatsApp, mở Cài đặt → Tác nhân, tạo tác nhân, rồi sao chép khóa từ trò chuyện của tác nhân → Thông tin trò chuyện → Khóa API.",
"help": "Trong WhatsApp, mở Cài đặt → Tác nhân, tạo tác nhân, rồi sao chép khóa từ trò chuyện của tác nhân → Thông tin trò chuyện → Khóa API."
"placeholder": "Trong WhatsApp, mở Cài đặt → Tác nhân, tạo tác nhân, rồi sao chép khóa từ trò chuyện của tác nhân → Thông tin trò chuyện → Khóa API."
},
"allowFrom": {
"label": "Người gửi được phép",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "打开智能体设置指南",
"officialLabel": "打开 WhatsApp 智能体帮助",
"summary": "通过 WhatsApp Agent Platform API 接入 nanobot。只有你可以与它对话,它无法访问你的其他 WhatsApp 聊天。",
"privacyNotice": "智能体对话不采用端到端加密。消息由 nanobot 和你配置的模型服务商处理。",
"fields": {
"token": {
"label": "API 令牌",
"placeholder": "在 WhatsApp 中打开 设置 → 智能体,创建智能体,然后从智能体聊天 → 聊天信息 → API 密钥 复制密钥。",
"help": "在 WhatsApp 中打开 设置 → 智能体,创建智能体,然后从智能体聊天 → 聊天信息 → API 密钥 复制密钥。"
"placeholder": "在 WhatsApp 中打开 设置 → 智能体,创建智能体,然后从智能体聊天 → 聊天信息 → API 密钥 复制密钥。"
},
"allowFrom": {
"label": "允许的发送者",
@@ -2,13 +2,11 @@
"setup": {
"docsLabel": "開啟代理設定指南",
"officialLabel": "開啟 WhatsApp 代理說明",
"summary": "透過 WhatsApp Agent Platform API 連接 nanobot。只有你可以與它對話,它無法存取你的其他 WhatsApp 聊天。",
"privacyNotice": "代理對話不採用端對端加密。訊息由 nanobot 和你設定的模型服務供應商處理。",
"fields": {
"token": {
"label": "API 權杖",
"placeholder": "在 WhatsApp 中開啟 設定 → 代理,建立代理,然後從代理聊天 → 聊天資訊 → API 金鑰 複製金鑰。",
"help": "在 WhatsApp 中開啟 設定 → 代理,建立代理,然後從代理聊天 → 聊天資訊 → API 金鑰 複製金鑰。"
"placeholder": "在 WhatsApp 中開啟 設定 → 代理,建立代理,然後從代理聊天 → 聊天資訊 → API 金鑰 複製金鑰。"
},
"allowFrom": {
"label": "允許的寄件者",