fix(deps): force prompt=False on the two mid-session lazy-install tool paths

The vision (Pillow) and faster-whisper STT tool paths were the only
ensure() call sites that defaulted to prompt=True, so they could fire a
blocking input() confirmation mid-session. Every other call site already
passes prompt=False. Under the interactive CLI prompt_toolkit owns stdin,
so that input() deadlocks the terminal (#40490). The install is already
gated by security.allow_lazy_installs, so the prompt was redundant
consent anyway. This makes the deadlock-capable input() branch
unreachable from any tool-call path.
This commit is contained in:
teknium1
2026-06-06 18:44:15 -07:00
committed by Teknium
parent d47f919ef1
commit c3d750c1ae
3 changed files with 15 additions and 7 deletions
+5 -1
View File
@@ -422,7 +422,11 @@ def _resize_image_for_vision(image_path: Path, mime_type: Optional[str] = None,
# the raw bytes and let the caller raise the size error.
try:
from tools.lazy_deps import ensure as _ensure_dep
_ensure_dep("tool.vision")
# prompt=False: never raise a blocking input() prompt mid-session.
# Under the interactive CLI prompt_toolkit owns stdin, so a bare
# input() deadlocks the terminal (#40490). The install is already
# gated by security.allow_lazy_installs, so reaching here is opt-in.
_ensure_dep("tool.vision", prompt=False)
from PIL import Image
import io as _io
except Exception: