Change default self-update backup directory from /a0/tmp to /root and add lazy aiogram dependency loading for Telegram plugin

- Update default backup path from /a0/tmp/self-update-backups to /root/update-backups in self_update_manager.py, helpers/self_update.py, and documentation
- Move aiogram from global requirements.txt to plugin-local requirements for _telegram_integration
- Add ensure_dependencies() helper that installs aiogram on-demand via uv pip install
- Add has_aiogram() check to avoid
This commit is contained in:
frdel 2026-03-26 10:20:35 +01:00
parent 68ad5aca46
commit 247c8d845f
15 changed files with 135 additions and 35 deletions

View file

@ -2,10 +2,14 @@ from helpers.extension import Extension
from helpers.print_style import PrintStyle
from helpers.errors import format_error
from agent import AgentContext, LoopData, UserMessage
from plugins._telegram_integration.helpers.handler import (
CTX_TG_BOT, CTX_TG_ATTACHMENTS, CTX_TG_KEYBOARD,
CTX_TG_TYPING_STOP, CTX_TG_REPLY_TO,
from plugins._telegram_integration.helpers.constants import (
CTX_TG_BOT,
CTX_TG_ATTACHMENTS,
CTX_TG_KEYBOARD,
CTX_TG_TYPING_STOP,
CTX_TG_REPLY_TO,
)
from plugins._telegram_integration.helpers.dependencies import ensure_dependencies
MAX_SEND_RETRIES: int = 2
CTX_SEND_FAILURES: str = "_telegram_send_failures"
@ -46,6 +50,7 @@ class TelegramAutoReply(Extension):
attachments: list[str],
keyboard: list[list[dict]] | None,
):
ensure_dependencies()
from plugins._telegram_integration.helpers.handler import send_telegram_reply
error = await send_telegram_reply(