diff --git a/harness/tg_inbox.py b/harness/tg_inbox.py index 75554a0..1ed3491 100644 --- a/harness/tg_inbox.py +++ b/harness/tg_inbox.py @@ -315,8 +315,13 @@ def _default_chat_id(): if not TG_TOKEN: return None model = es.run_projections() + # portal:* — это портал-канал (t-261001123121), не Telegram: файлы/тексты + # туда идут через push portal_channel, а не через API Telegram. + # Без фильтра E2E/чат портала «перебивает» личку Alex дефолтным чатом + # → send_message/send_document падают 'chat not found' (найдено 02.10). inbox = [m for m in (model.get("inbox") or {}).values() - if m.get("chat_id") and not m.get("ignored")] + if m.get("chat_id") and not str(m.get("chat_id")).startswith("portal") + and not m.get("ignored")] if not inbox: return None # некому: чат ещё не известен return sorted(inbox, key=lambda m: m.get("ts") or "")[-1]["chat_id"]