You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: an exception without a message gives an empty error in the log and for the model #5975
When an action or a step fails with an exception that has no message, such as TimeoutError(), ConnectionError() or a failed bare assert, browser-use formats it with str(e), which is empty:
AgentError.format_error returns '' (agent/views.py#L966, #L980-L982), so _handle_step_error logs ❌ Result failed 1/6 times: with nothing after the colon and puts an empty error into the next prompt.
Neither the log nor the model gets the exception type. I see these empty lines in a production app. session.py already logs the type for the same navigation failure (Navigation failed: {type(e).__name__}: {e}, session.py#L1005); the action and the agent do not.
Repro: format_error directly, then navigate on headless Chromium with _navigate_and_wait replaced by a function that raises ConnectionError().
Failing Python Code
importasynciofromimportlib.metadataimportversionfrombrowser_use.agent.viewsimportAgentErrorfrombrowser_use.browserimportBrowserProfile, BrowserSessionfrombrowser_use.tools.serviceimportToolsasyncdefdrop_connection(*args, **kwargs):
raiseConnectionError() # stands in for any failure raised without a messageasyncdefmain() ->None:
print('browser-use', version('browser-use'))
forerrorin (TimeoutError(), ConnectionError(), AssertionError()):
print(f'AgentError.format_error({type(error).__name__}()) = {AgentError.format_error(error)!r}')
session=BrowserSession(browser_profile=BrowserProfile(headless=True, user_data_dir=None, enable_default_extensions=False))
awaitsession.start()
BrowserSession._navigate_and_wait=drop_connectionresult=awaitTools().navigate(url='http://127.0.0.1:9/', new_tab=False, browser_session=session)
print('navigate ActionResult.error =', repr(result.error))
awaitsession.kill()
asyncio.run(main())
Activity