From adee8d1b5ff091e7532c03c23b1a68c8b5fde314 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 24 Mar 2026 19:10:12 -0700 Subject: [PATCH] fix: browser_vision ignores auxiliary.vision.timeout config (#2901) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: unify hooks documentation — add plugin hooks to hooks page, add session:end event The hooks page only documented gateway event hooks (HOOK.yaml system). The plugins page listed plugin hooks (pre_tool_call, etc.) that weren't referenced from the hooks page, which was confusing. Changes: - hooks.md: Add overview table showing both hook systems - hooks.md: Add Plugin Hooks section with available hooks, callback signatures, and example - hooks.md: Add missing session:end gateway event (emitted but undocumented) - hooks.md: Mark pre_llm_call, post_llm_call, on_session_start, on_session_end as planned (defined in VALID_HOOKS but not yet invoked) - hooks.md: Update info box to cross-reference plugin hooks - hooks.md: Fix heading hierarchy (gateway content as subsections) - plugins.md: Add cross-reference to hooks page for full details - plugins.md: Mark planned hooks as (planned) * fix: browser_vision ignores auxiliary.vision.timeout config browser_vision called call_llm() without passing a timeout parameter, so it always used the 30-second default in auxiliary_client.py. This made vision analysis with local models (llama.cpp, ollama) impossible since they typically need more than 30s for screenshot analysis. Now browser_vision reads auxiliary.vision.timeout from config.yaml (same config key that vision_analyze already uses) and passes it through to call_llm(). Also bumped the default vision timeout from 30s to 120s in both browser_vision and vision_analyze — 30s is too aggressive for local models and the previous default silently failed for anyone running vision locally. Fixes user report from GamerGB1988. --- tools/browser_tool.py | 15 +++++++++++++++ tools/vision_tools.py | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) 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()