{"record":{"id":"f5de7f9513a80485","repo":"browser-use/browser-use","slug":"llm-screenshot-size-dimensions-must-be-at-least-10","errorCode":null,"errorMessage":"llm_screenshot_size dimensions must be at least 100 pixels","messagePattern":"llm_screenshot_size dimensions must be at least 100 pixels","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"browser_use/agent/service.py","lineNumber":222,"sourceCode":"\t\tplanning_exploration_limit: int = 5,\n\t\tloop_detection_window: int = 20,\n\t\tloop_detection_enabled: bool = True,\n\t\tllm_screenshot_size: tuple[int, int] | None = None,\n\t\tmessage_compaction: MessageCompactionSettings | bool | None = True,\n\t\tmax_clickable_elements_length: int = 40000,\n\t\t_url_shortening_limit: int = 25,\n\t\tenable_signal_handler: bool = True,\n\t\t**kwargs,\n\t):\n\t\t# Validate llm_screenshot_size\n\t\tif llm_screenshot_size is not None:\n\t\t\tif not isinstance(llm_screenshot_size, tuple) or len(llm_screenshot_size) != 2:\n\t\t\t\traise ValueError('llm_screenshot_size must be a tuple of (width, height)')\n\t\t\twidth, height = llm_screenshot_size\n\t\t\tif not isinstance(width, int) or not isinstance(height, int):\n\t\t\t\traise ValueError('llm_screenshot_size dimensions must be integers')\n\t\t\tif width < 100 or height < 100:\n\t\t\t\traise ValueError('llm_screenshot_size dimensions must be at least 100 pixels')\n\t\t\tself.logger.info(f'🖼️  LLM screenshot resizing enabled: {width}x{height}')\n\t\tif llm is None:\n\t\t\tdefault_llm_name = CONFIG.DEFAULT_LLM\n\t\t\tif default_llm_name:\n\t\t\t\tfrom browser_use.llm.models import get_llm_by_name\n\n\t\t\t\tllm = get_llm_by_name(default_llm_name)\n\t\t\telse:\n\t\t\t\t# No default LLM specified, use the original default\n\t\t\t\tfrom browser_use import ChatBrowserUse\n\n\t\t\t\tllm = ChatBrowserUse()\n\n\t\t# set flashmode = True if llm is ChatBrowserUse\n\t\tif llm.provider == 'browser-use':\n\t\t\tflash_mode = True\n\n\t\t# Flash mode strips plan fields from the output schema, so planning is structurally impossible","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/browser-use/browser-use/blob/6c73fced2f6d45a11d88622fe56365a5fe18f28b/browser_use/agent/service.py#L204-L240","documentation":"Agent.__init__ validation: both dimensions are ints but at least one is below 100 pixels. Screenshots smaller than 100px are useless for vision models, so the constructor enforces a floor. Both width AND height must be >= 100.","triggerScenarios":"Passing (64, 64) thumbnails; passing (0, 0) or negative values as 'disabled' sentinel; unit-test fixtures using tiny sizes; computed sizes that shrink with viewport math (e.g. width // 20).","commonSituations":"Trying to cut token cost with very small screenshots; test configs copied from unit tests; accidental transposition of coordinates or percentages (e.g. (10, 10) meaning 10%).","solutions":["Use at least 100x100; token savings are better achieved with vision_detail_level='low'","If the intent was to disable resizing, pass llm_screenshot_size=None instead of tiny values","Clamp computed sizes: size = (max(100, w), max(100, h))"],"exampleFix":"# before\nagent = Agent(task=..., llm=llm, llm_screenshot_size=(64, 64))\n\n# after\nagent = Agent(task=..., llm=llm, llm_screenshot_size=None)  # disable resize\n# or\nagent = Agent(task=..., llm=llm, vision_detail_level='low')  # cheaper vision","handlingStrategy":"validation","validationCode":"size = None if size is None else (max(100, int(size[0])), max(100, int(size[1])))","typeGuard":"def is_valid_screenshot_size(v) -> bool:\n    return v is None or (isinstance(v, tuple) and len(v) == 2 and all(isinstance(x, int) and x >= 100 for x in v))","tryCatchPattern":"null","preventionTips":["Pass None to disable resizing rather than tiny values","Use vision_detail_level='low' for token savings instead of undersized screenshots"],"tags":["configuration","validation","screenshot","vision"],"backgroundTag":null,"analyzedSha":"6c73fced2f6d45a11d88622fe56365a5fe18f28b","analyzedAt":"2026-08-14T19:42:40.557Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}