{"record":{"id":"a1714159cff2b815","repo":"NousResearch/hermes-agent","slug":"failed-to-create-telegram-private-dm-topic-targe","errorCode":null,"errorMessage":"Failed to create Telegram private DM topic '{target_thread_id}'","messagePattern":"Failed to create Telegram private DM topic '(.+?)'","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"gateway/delivery.py","lineNumber":579,"sourceCode":"            target_thread_id = target.thread_id\n            is_named_telegram_private_topic = (\n                target.platform == Platform.TELEGRAM\n                and looks_like_telegram_private_chat_id(target.chat_id)\n                and not _looks_like_int(target_thread_id)\n                and \"thread_id\" not in send_metadata\n                and \"message_thread_id\" not in send_metadata\n                and not has_explicit_direct_topic\n            )\n            if is_named_telegram_private_topic:\n                named_telegram_private_topic_name = target_thread_id\n                ensure_dm_topic = getattr(adapter, \"ensure_dm_topic\", None)\n                if ensure_dm_topic is None:\n                    raise RuntimeError(\n                        \"Telegram adapter cannot create named private DM topics\"\n                    )\n                created_thread_id = await ensure_dm_topic(target.chat_id, target_thread_id)\n                if not created_thread_id:\n                    raise RuntimeError(\n                        f\"Failed to create Telegram private DM topic '{target_thread_id}'\"\n                    )\n                target_thread_id = str(created_thread_id)\n                send_metadata[\"thread_id\"] = target_thread_id\n                send_metadata[\"telegram_dm_topic_created_for_send\"] = True\n            elif (\n                target.platform == Platform.TELEGRAM\n                and looks_like_telegram_private_chat_id(target.chat_id)\n                and \"thread_id\" not in send_metadata\n                and \"message_thread_id\" not in send_metadata\n                and not has_explicit_direct_topic\n            ):\n                # Legacy private topic/thread ids that were not created by this\n                # send path may still need a reply anchor to stay visible in the\n                # requested lane. Named targets are created above via\n                # createForumTopic and can use message_thread_id directly.\n                reply_anchor = send_metadata.get(\"telegram_reply_to_message_id\")\n                if reply_anchor is None:","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/gateway/delivery.py#L561-L597","documentation":"Error \"Failed to create Telegram private DM topic '{target_thread_id}'\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at gateway/delivery.py:579 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Telegram bot has permission to create topics and the chat id is valid, then retry.","Review gateway logs for the Telegram API error."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}