Skip to content

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

Enhance last step warning message clarity

Magnus Müller5f84512d74bd
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 262d19b7c..71c04fb63 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -343,7 +343,7 @@ 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. Use only the "done" action now. No other actions - so here your action sequence musst have length 1.'
- msg += '\nIf the task is not yet fully finished as requested by the user, set success in "done" to false!'
+ msg += '\nIf the task is not yet fully finished as requested by the user, set success in "done" to false! E.g. if not all steps are fully completed.'
msg += '\nIf the task is fully finished, set success in "done" to true.'
msg += '\nInclude everything you found out for the ultimate task in the done text.'
logger.info('Last step finishing up')