Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
show 4 chars of id instead of 3
Nick Sweeting6d2826b37ad6
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex abb7d35b1..ee8987853 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -176,7 +176,7 @@ class Agent(Generic[Context]):self.task_id: str = uuid7str()# Create instance-specific logger- self._logger = logging.getLogger(f'browser_use.Agent[{self.task_id[-3:]}]')+ self._logger = logging.getLogger(f'browser_use.Agent[{self.task_id[-4:]}]')# Core componentsself.task = taskdiff --git a/browser_use/browser/profile.py b/browser_use/browser/profile.pyindex c915f4209..77d481ab5 100644--- a/browser_use/browser/profile.py+++ b/browser_use/browser/profile.py@@ -618,10 +618,10 @@ class BrowserProfile(BrowserConnectArgs, BrowserLaunchPersistentContextArgs, Brodef __repr__(self) -> str:short_dir = _log_pretty_path(self.user_data_dir) if self.user_data_dir else '<incognito>'- return f'BrowserProfile[{self.id[-3:]}](user_data_dir= {short_dir}, headless={self.headless})'+ return f'BrowserProfile[{self.id[-4:]}](user_data_dir= {short_dir}, headless={self.headless})'def __str__(self) -> str:- return f'BrowserProfile[{self.id[-3:]}]'+ return f'BrowserProfile[{self.id[-4:]}]'@model_validator(mode='after')def copy_old_config_names_to_new(self) -> Self:diff --git a/browser_use/browser/session.py b/browser_use/browser/session.pyindex acce0b32a..e218e0be9 100644--- a/browser_use/browser/session.py+++ b/browser_use/browser/session.py@@ -244,14 +244,14 @@ class BrowserSession(BaseModel):"""Get instance-specific logger with session ID in the name"""if self._logger is None:# Create a child logger with the session ID- self._logger = logging.getLogger(f'browser_use.BrowserSession[{self.id[-3:]}]')+ self._logger = logging.getLogger(f'browser_use.BrowserSession[{self.id[-4:]}]')return self._loggerdef __repr__(self) -> str:- return f'BrowserSession[{self.id[-3:]}](profile={self.browser_profile}, {self._connection_str})'+ return f'BrowserSession[{self.id[-4:]}](profile={self.browser_profile}, {self._connection_str})'def __str__(self) -> str:- return f'BrowserSession[{self.id[-3:]}]'+ return f'BrowserSession[{self.id[-4:]}]'# def __getattr__(self, key: str) -> Any:# """