Skip to content

Commit 9c8238c

Browse files
authored
Update core.py
1 parent 8028ca6 commit 9c8238c

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

‎python_agent_harness/tui/core.py‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -334,22 +334,11 @@ def _start_agent(
334334
has_image_parts = has_images or (
335335
attachments and any(isinstance(a.part, ImagePart) for a in attachments)
336336
)
337-
if has_image_parts:
338-
from ..config import get_model_info
339-
340-
# A malformed image_input_models config must not break the
341-
# submit path; fall back to the built-in table on error.
342-
try:
343-
supports_images = get_model_info(
344-
self.session.model, config_path=self.session.config_path
345-
).supports_image_input
346-
except Exception: # noqa: BLE001 - config error must not block input
347-
supports_images = get_model_info(self.session.model).supports_image_input
348-
if not supports_images:
349-
self.console.print(
350-
f"[yellow]warning: model {self.session.model} does not support "
351-
"image input — image attachment(s) will be ignored[/yellow]"
352-
)
337+
if has_image_parts and not self.session.supports_image_input:
338+
self.console.print(
339+
f"[yellow]warning: model {self.session.model} does not support "
340+
"image input — image attachment(s) will be ignored[/yellow]"
341+
)
353342

354343
# Store for _run_agent to pick up (avoids re-parsing there)
355344
self._pending_user_msg = user_msg

0 commit comments

Comments
 (0)