FoundationAgents/OpenManus · error · ValueError
Parameters cannot be empty
Error message
Parameters cannot be empty
What it means
Pydantic field_validator (mode='before') on BrowserUseTool.parameters rejects empty input: constructing or validating the tool with parameters={} or parameters=None raises ValueError('Parameters cannot be empty'). The parameters field carries the browser-use action instruction (e.g. {'action': 'go_to_url', 'url': ...}), and an empty value is meaningless, so validation fails at model time, before any browser work starts.
Source
Thrown at app/tool/browser_use_tool.py:138
"extract_content": ["goal"],
},
}
lock: asyncio.Lock = Field(default_factory=asyncio.Lock)
browser: Optional[BrowserUseBrowser] = Field(default=None, exclude=True)
context: Optional[BrowserContext] = Field(default=None, exclude=True)
dom_service: Optional[DomService] = Field(default=None, exclude=True)
web_search_tool: WebSearch = Field(default_factory=WebSearch, exclude=True)
# Context for generic functionality
tool_context: Optional[Context] = Field(default=None, exclude=True)
llm: Optional[LLM] = Field(default_factory=LLM)
@field_validator("parameters", mode="before")
def validate_parameters(cls, v: dict, info: ValidationInfo) -> dict:
if not v:
raise ValueError("Parameters cannot be empty")
return v
async def _ensure_browser_initialized(self) -> BrowserContext:
"""Ensure browser and context are initialized."""
if self.browser is None:
browser_config_kwargs = {"headless": False, "disable_security": True}
if config.browser_config:
from browser_use.browser.browser import ProxySettings
# handle proxy settings.
if config.browser_config.proxy and config.browser_config.proxy.server:
browser_config_kwargs["proxy"] = ProxySettings(
server=config.browser_config.proxy.server,
username=config.browser_config.proxy.username,
password=config.browser_config.proxy.password,
)
View on GitHub (pinned to 52a13f2a57)
Solutions
- Always supply the required action dict: parameters={'action': 'open_tab', 'url': 'https://example.com'} (fields per the browser-use ActionModel).
- If the LLM can emit empty tool calls, validate and reject upstream (check the parsed arguments are non-empty) and re-prompt instead of letting pydantic raise.
- Catch pydantic's ValidationError at the dispatch layer and map it to a user-facing 'missing browser action parameters' message.
Example fix
# before
result = await browser_tool.execute(action=None, parameters={})
# after
params = {"action": "go_to_url", "url": "https://example.com"}
result = await browser_tool.execute(action="", parameters=params) Defensive patterns
Strategy: validation
Validate before calling
params = tool_call.get('parameters') or {}
if not params or 'action' not in params:
raise ValueError('browser tool call needs parameters.action')
result = await browser_tool.execute(action=tool_call.get('action', ''), parameters=params) Type guard
from pydantic import ValidationError
def is_valid_browser_params(v: object) -> bool:
if not isinstance(v, dict) or not v:
return False
return isinstance(v.get('action'), str) and bool(v['action']) Try / catch
try:
result = await browser_tool.execute(action=a, parameters=params)
except ValidationError as e:
if 'Parameters cannot be empty' in str(e):
return 'error: browser action requires parameters (e.g. {"action": "go_to_url", "url": ...})'
raise Prevention
- Validate LLM tool-call arguments are non-empty before model validation.
- Include a schema example in the tool description so the model emits the action dict.
- Map ValidationError to a re-prompt, not a crash.
When it happens
Trigger: Building BrowserUseTool via pydantic validation with an omitted/empty parameters dict — typically an LLM emitting a tool call with no arguments, or code instantiating the tool to inspect its schema (model_validate on default empty dict).
Common situations: Agent framework parses an LLM tool call whose arguments JSON was empty ({}); tests instantiating the tool without arguments; schema-registration code that validates a default instance.
Related errors
- Server URL is required for SSE connection
- Command is required for stdio connection
- Unsupported connection type: {self.connection_type}
- Tool calls required but none provided
- Failed to load MCP server config: {e}
AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15).
Data as JSON: /api/errors/f2c417c61d12e5ed.
Report an issue: GitHub.