# CVC Learnings

[LRN-20260404-001] [High] [Telegram Integration]
Summary: Implemented native async long-polling Telegram bot inside FastAPI lifespan using `aiogram` 3.x. Used an `asyncio.Queue` / buffer system (TelegramStreamer) to coalescence chunked LLM outputs to respect Telegram's rate limits (`edit_message_text`). Intercepted tool executions in the streaming loop to provide native Inline Keyboard gates for sensitive tool calls. Handled async state locks per Telegram user session to prevent race conditions when multiple messages arrive quickly. Added dynamic HTML parse mode stripping during token streaming to prevent unbalanced tags crashing the bot.