Skip to content

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

Update label

Magnus Müller7e8eb3d5716d
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py
index cf7d2e241..c8033e285 100644
--- a/browser_use/agent/prompts.py
+++ b/browser_use/agent/prompts.py
@@ -239,11 +239,11 @@ Interactive elements from top layer of the current page inside the viewport{trun
# Add screenshots with labels
for i, screenshot in enumerate(unique_screenshots):
- steps_ago = len(unique_screenshots) - 1 - i
- if steps_ago == 0:
+ if i == len(unique_screenshots) - 1:
label = 'Current screenshot:'
else:
- label = 'Past screenshot from previous step:'
+ # Use simple, accurate labeling since we don't have actual step timing info
+ label = 'Previous screenshot:'
# Add label as text content
content_parts.append(ContentPartTextParam(text=label))