{"record":{"id":"033b1061d2f619af","repo":"browser-use/browser-use","slug":"llm-screenshot-size-dimensions-must-be-at-least-10-033b10","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/beta/service.py","lineNumber":4312,"sourceCode":"\t\tplanning_replan_on_stall: int = 3,\n\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\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\tllm = _resolve_default_llm(llm)\n\t\tuse_vision = True\n\t\tif browser and browser_session:\n\t\t\traise ValueError('Cannot specify both \"browser\" and \"browser_session\" parameters. Use \"browser\" for the cleaner API.')\n\t\tif getattr(llm, 'provider', None) == 'browser-use':\n\t\t\tflash_mode = True\n\t\tif flash_mode:\n\t\t\tenable_planning = False\n\t\tif llm_screenshot_size is None:\n\t\t\tmodel_name = getattr(llm, 'model', '')\n\t\t\t# rsplit drops the provider prefix so gateway ids like 'anthropic/claude-sonnet-4-6'\n\t\t\t# get the same screenshot auto-config as direct Claude Sonnet models.\n\t\t\tif isinstance(model_name, str) and model_name.rsplit('/', 1)[-1].startswith('claude-sonnet'):\n\t\t\t\tllm_screenshot_size = (1400, 850)\n\t\tif page_extraction_llm is None:\n\t\t\tpage_extraction_llm = llm\n\t\tif judge_llm is None:\n\t\t\tjudge_llm = llm","sourceCodeStart":4294,"sourceCodeEnd":4330,"githubUrl":"https://github.com/browser-use/browser-use/blob/6c73fced2f6d45a11d88622fe56365a5fe18f28b/browser_use/beta/service.py#L4294-L4330","documentation":"Final stage of `llm_screenshot_size` validation: both dimensions must be at least 100 pixels. Screenshots smaller than 100x100 are useless for vision models, so the beta agent rejects them at construction time rather than producing degraded runs.","triggerScenarios":"Passing values below 100 in either dimension, e.g. `(80, 600)`, `(1400, 50)`, or a scaling computation that rounds a dimension under 100. Booleans (True == 1) also land here.","commonSituations":"Derived sizes (crop regions, thumbnail scales) accidentally below the floor; typos like (14, 85) for (1400, 850); unit confusion treating the tuple as a fraction/scale factor.","solutions":["Use real pixel dimensions ≥ 100 in both axes, e.g. `(1280, 720)`.","Clamp derived sizes: `(max(100, w), max(100, h))`.","If you wanted a scale factor, multiply the viewport instead of passing the fraction directly."],"exampleFix":"# before\nagent = BetaAgent(task=t, llm_screenshot_size=(0.8, 0.8))  # meant as scale, fails 100px floor\n\n# after\nagent = BetaAgent(task=t, llm_screenshot_size=(1280, 720))","handlingStrategy":"validation","validationCode":"MIN = 100\nsize = (max(MIN, w), max(MIN, h)) if isinstance(w, int) and isinstance(h, int) else None","typeGuard":"def meets_min_size(v) -> bool:\n    return v is None or (isinstance(v, tuple) and len(v) == 2 and all(isinstance(d, int) and d >= 100 for d in v))","tryCatchPattern":null,"preventionTips":["Pass real pixel sizes (e.g. 1280x720), never scale factors.","Clamp programmatically derived dimensions to a 100px floor."],"tags":["beta","validation","configuration","screenshots"],"backgroundTag":null,"analyzedSha":"6c73fced2f6d45a11d88622fe56365a5fe18f28b","analyzedAt":"2026-08-14T19:42:40.557Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}