Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gateway/platforms/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ async def _handle_polling_conflict(self, error: Exception) -> None:
try:
await self._app.updater.start_polling(
allowed_updates=Update.ALL_TYPES,
drop_pending_updates=False,
drop_pending_updates=True,
error_callback=self._polling_error_callback_ref,
)
logger.info(
Expand Down
18 changes: 17 additions & 1 deletion tools/lazy_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,23 @@ def ensure(feature: str, *, prompt: bool = True) -> None:
"lazy installs disabled (security.allow_lazy_installs=false)"
)

if prompt and sys.stdin.isatty() and sys.stdout.isatty():
# Only show the interactive confirmation when we own a TTY and
# prompt_toolkit isn't running. A bare input() deadlocks when a
# prompt_toolkit app owns the terminal because keystrokes route to
# its event loop rather than stdin, so the prompt blocks forever.
# Under the TUI we skip the prompt and proceed — lazy installs are
# gated by security.allow_lazy_installs, so reaching here is
# already user opt-in.
_pt_active = False
if "prompt_toolkit.application.current" in sys.modules:
try:
from prompt_toolkit.application.current import get_app_or_none
_app = get_app_or_none()
_pt_active = _app is not None and getattr(_app, "is_running", False)
except Exception:
_pt_active = False

if prompt and not _pt_active and sys.stdin.isatty() and sys.stdout.isatty():
spec_list = ", ".join(missing)
try:
answer = input(
Expand Down
Loading