diff --git a/tools/browser_tool.py b/tools/browser_tool.py index 0b51034528..a3e35570cb 100644 --- a/tools/browser_tool.py +++ b/tools/browser_tool.py @@ -1567,6 +1567,20 @@ def browser_vision(question: str, annotate: bool = False, task_id: Optional[str] vision_model = _get_vision_model() logger.debug("browser_vision: analysing screenshot (%d bytes)", len(image_data)) + + # Read vision timeout from config (auxiliary.vision.timeout), default 120s. + # Local vision models (llama.cpp, ollama) can take well over 30s for + # screenshot analysis, so the default must be generous. + vision_timeout = 120.0 + try: + from hermes_cli.config import load_config + _cfg = load_config() + _vt = _cfg.get("auxiliary", {}).get("vision", {}).get("timeout") + if _vt is not None: + vision_timeout = float(_vt) + except Exception: + pass + call_kwargs = { "task": "vision", "messages": [ @@ -1580,6 +1594,7 @@ def browser_vision(question: str, annotate: bool = False, task_id: Optional[str] ], "max_tokens": 2000, "temperature": 0.1, + "timeout": vision_timeout, } if vision_model: call_kwargs["model"] = vision_model diff --git a/tools/vision_tools.py b/tools/vision_tools.py index f27fbfa686..c9e62076d1 100644 --- a/tools/vision_tools.py +++ b/tools/vision_tools.py @@ -325,8 +325,9 @@ async def vision_analyze_tool( logger.info("Processing image with vision model...") # Call the vision API via centralized router. - # Read timeout from config.yaml (auxiliary.vision.timeout), default 30s. - vision_timeout = 30.0 + # Read timeout from config.yaml (auxiliary.vision.timeout), default 120s. + # Local vision models (llama.cpp, ollama) can take well over 30s. + vision_timeout = 120.0 try: from hermes_cli.config import load_config _cfg = load_config()