Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Update prompts and service files: increase max clickable elements length and enhance file writing instructions to specify allowed extensions.

mertunsalla0e60a150372
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py
index ed1ad98b4..b02cb32ef 100644
--- a/browser_use/agent/prompts.py
+++ b/browser_use/agent/prompts.py
@@ -71,7 +71,7 @@ class AgentMessagePrompt:
include_attributes: list[str] | None = None,
step_info: Optional['AgentStepInfo'] = None,
page_filtered_actions: str | None = None,
- max_clickable_elements_length: int = 10000,
+ max_clickable_elements_length: int = 40000,
):
self.browser_state: 'BrowserStateSummary' = browser_state_summary
self.file_system: 'FileSystem' | None = file_system
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index bf898fc88..88996f408 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -470,7 +470,7 @@ class Agent(Generic[Context]):
logger.info(f'💾 File system path: {self.file_system_path}')
# if file system is set, add actions to the controller
- @self.controller.registry.action('Write content to file_name in file system')
+ @self.controller.registry.action('Write content to file_name in file system, use only .md or .txt extensions.')
async def write_file(file_name: str, content: str):
result = await self.file_system.write_file(file_name, content)
logger.info(f'💾 {result}')