Skip to content

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

update to system prompt and agent state

mertunsalld426c53c1bc5
diff --git a/browser_use/agent/message_manager/service.py b/browser_use/agent/message_manager/service.py
index 3245b1c07..203af0deb 100644
--- a/browser_use/agent/message_manager/service.py
+++ b/browser_use/agent/message_manager/service.py
@@ -367,7 +367,10 @@ My next action is to click on the iPhone link at index [4] to navigate to Apple'
if None in [model_output, result, step_info]:
return
- self.read_state_description = '# Read State\n'
+ self.read_state_initialization = (
+ '# Read State (displayed only **one time**, save this information if you need it later)\n'
+ )
+ self.read_state_description = self.read_state_initialization
step_number = step_info.step_number
@@ -393,7 +396,7 @@ Memory: {model_output.current_state.memory}
Next goal: {model_output.current_state.next_goal}
{action_results}
"""
- if self.read_state_description == '# Read State\n':
+ if self.read_state_description == self.read_state_initialization:
self.read_state_description = ''
@time_execution_sync('--add_state_message')
diff --git a/browser_use/agent/system_prompt.md b/browser_use/agent/system_prompt.md
index 81302bae8..c035f6f9c 100644
--- a/browser_use/agent/system_prompt.md
+++ b/browser_use/agent/system_prompt.md
@@ -112,7 +112,7 @@ In the `done` action:
- Set `success` to `true` only if the full USER REQUEST has been completed with no missing components.
- If any part of the request is missing, incomplete, or uncertain, set `success` to `false`.
- In all cases, include all relevant findings and outputs in the `text` field of the `done` action.
-- NEVER mention `todo.md`, `results.md`, or any other file in the `text` field.
+- Use `files_to_display` field to provide a list of files to display to the user.
</task_completion_rules>
<action_rules>
@@ -156,6 +156,7 @@ Exhibit the following reasoning patterns:
6. **Before Calling `done`**
- Verify completeness—e.g., if the user asked to collect all products, confirm all were found by checking there are no further pages.
+- If you would like to display some files to the user, make sure to read them using `read_file` before to verify content.
</reasoning_rules>
<output>