Skip to content

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

Simplify last step instructions for agent service

Magnus Müller65e165c91582
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 364b21475..a9669957c 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -342,10 +342,10 @@ class Agent(Generic[Context]):
if step_info and step_info.is_last_step():
# Add last step warning if needed
- msg = 'Now comes your last step. You have to use the "done" action now immediately! No other actions are allowed.'
+ msg = 'Now comes your last step. Use only the "done" function now.'
msg += '\nIf the task is not fully finished as requested by the user, set success in "done" to false!'
msg += '\nIf the task is fully finished, set success in "done" to true.'
- msg += '\nMake sure you include everything you found out for the ultimate task in the done text parameter.'
+ msg += '\nInclude everything you found out for the ultimate task in the done text.'
logger.info('Last step finishing up')
self._message_manager._add_message_with_tokens(HumanMessage(content=msg))
self.AgentOutput = self.DoneAgentOutput