{"record":{"id":"fb37e1b57c3dc877","repo":"browser-use/browser-use","slug":"session-id-is-required-for-scroll-operations","errorCode":null,"errorMessage":"Session ID is required for scroll operations","messagePattern":"Session ID is required for scroll operations","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"browser_use/actor/mouse.py","lineNumber":101,"sourceCode":"\t\tawait self._client.send.Input.dispatchMouseEvent(\n\t\t\tparams,\n\t\t\tsession_id=self._session_id,\n\t\t)\n\n\tasync def move(self, x: int, y: int, steps: int = 1) -> None:\n\t\t\"\"\"Move mouse to the specified coordinates.\"\"\"\n\t\t# TODO: Implement smooth movement with multiple steps if needed\n\t\t_ = steps  # Acknowledge parameter for future use\n\n\t\tparams: 'DispatchMouseEventParameters' = {'type': 'mouseMoved', 'x': x, 'y': y}\n\t\tawait self._client.send.Input.dispatchMouseEvent(params, session_id=self._session_id)\n\n\tasync def scroll(\n\t\tself, x: int | None = None, y: int | None = None, delta_x: int | None = None, delta_y: int | None = None\n\t) -> None:\n\t\t\"\"\"Scroll the page using robust CDP methods.\"\"\"\n\t\tif not self._session_id:\n\t\t\traise RuntimeError('Session ID is required for scroll operations')\n\n\t\t# Get viewport dimensions (used to resolve x/y when the caller doesn't specify a coordinate)\n\t\ttry:\n\t\t\tlayout_metrics = await self._client.send.Page.getLayoutMetrics(session_id=self._session_id)\n\t\t\tviewport_width = layout_metrics['layoutViewport']['clientWidth']\n\t\t\tviewport_height = layout_metrics['layoutViewport']['clientHeight']\n\t\texcept Exception:\n\t\t\tviewport_width = viewport_height = 0\n\n\t\tscroll_x, scroll_y = _resolve_scroll_anchor(x, y, viewport_width, viewport_height)\n\n\t\t# Calculate scroll deltas (positive = down/right)\n\t\tscroll_delta_x = delta_x or 0\n\t\tscroll_delta_y = delta_y or 0\n\n\t\t# Method 1: Try mouse wheel event (most reliable)\n\t\ttry:\n\t\t\tawait self._client.send.Input.dispatchMouseEvent(","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/browser-use/browser-use/blob/6c73fced2f6d45a11d88622fe56365a5fe18f28b/browser_use/actor/mouse.py#L83-L119","documentation":"The 'required available_file_paths not provided' raise from the not-in-kwargs branch: the action declares available_file_paths with no default and neither the caller nor the agent context supplied the allow-list. The registry treats an unrestricted/unknown file scope as an error rather than silently allowing arbitrary paths.","triggerScenarios":"await my_file_action(...) with no available_file_paths keyword while the action signature requires it; or an Agent run where available_file_paths was never configured and a custom action copies the built-in file tools' signature.","commonSituations":"Custom file actions mirrored from write_file/read_file; standalone Tools in tests; agent configured without available_file_paths but the task routes to a file action.","solutions":["Pass the allow-list explicitly: await my_action(..., available_file_paths=['/workspace/**']).","Set Agent(available_file_paths=[...]) so injection has a value.","Give the parameter a default in your custom action and enforce your own path checks."],"exampleFix":"# before\nawait export_csv(rows=[...])\n\n# after\nawait export_csv(rows=[...], available_file_paths=['/workspace/export.csv'])","handlingStrategy":"validation","validationCode":"from inspect import signature, Parameter\n\ndef file_paths_missing(func, provided: dict) -> bool:\n    p = signature(func).parameters.get('available_file_paths')\n    return p is not None and p.default is Parameter.empty and 'available_file_paths' not in provided","typeGuard":"def requires_available_file_paths(func) -> bool:\n    p = inspect.signature(func).parameters.get('available_file_paths')\n    return p is not None and p.default is inspect.Parameter.empty","tryCatchPattern":"try:\n    await action(**kwargs)\nexcept ValueError as e:\n    if 'requires available_file_paths' in str(e):\n        await action(**kwargs, available_file_paths=ALLOWED_PATHS)","preventionTips":["Set Agent(available_file_paths=[...]) whenever file actions are in play.","Pass the allow-list explicitly in direct invocation.","Keep the allow-list explicit and narrow; treat it as a security control."],"tags":["custom-actions","file-system","invocation","browser-use"],"backgroundTag":null,"analyzedSha":"6c73fced2f6d45a11d88622fe56365a5fe18f28b","analyzedAt":"2026-08-14T19:42:40.557Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}