fix(browser): honor auxiliary.vision.temperature for screenshot analysis\n\n- mirror the vision tool's config bridge in browser_vision

- add regression tests for configured and default temperature forwarding
This commit is contained in:
kshitijk4poor 2026-04-20 12:10:13 +05:30 committed by Teknium
parent 098d554aac
commit 9d88bdaf11
2 changed files with 67 additions and 4 deletions

View file

@ -2098,16 +2098,21 @@ def browser_vision(question: str, annotate: bool = False, task_id: Optional[str]
logger.debug("browser_vision: analysing screenshot (%d bytes)",
len(_screenshot_bytes))
# Read vision timeout from config (auxiliary.vision.timeout), default 120s.
# Read vision timeout/temperature from config (auxiliary.vision.*).
# Local vision models (llama.cpp, ollama) can take well over 30s for
# screenshot analysis, so the default must be generous.
# screenshot analysis, so the default timeout must be generous.
vision_timeout = 120.0
vision_temperature = 0.1
try:
from hermes_cli.config import load_config
_cfg = load_config()
_vt = _cfg.get("auxiliary", {}).get("vision", {}).get("timeout")
_vision_cfg = _cfg.get("auxiliary", {}).get("vision", {})
_vt = _vision_cfg.get("timeout")
if _vt is not None:
vision_timeout = float(_vt)
_vtemp = _vision_cfg.get("temperature")
if _vtemp is not None:
vision_temperature = float(_vtemp)
except Exception:
pass
@ -2123,7 +2128,7 @@ def browser_vision(question: str, annotate: bool = False, task_id: Optional[str]
}
],
"max_tokens": 2000,
"temperature": 0.1,
"temperature": vision_temperature,
"timeout": vision_timeout,
}
if vision_model: