Skip to content

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

skeleton hint: actionable data-driven wording; empty-page hint tells the model what to do

MagMueller69f69bb06ba0
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py
index 73e63a8d8..f955765c0 100644
--- a/browser_use/agent/prompts.py
+++ b/browser_use/agent/prompts.py
@@ -228,15 +228,18 @@ class AgentMessagePrompt:
# Format statistics
stats_text = '<page_stats>'
if page_stats['total_elements'] < 10:
- stats_text += 'Page appears empty (SPA not loaded?) - '
- # Skeleton screen: low text density only means "loading" while requests are actually in flight;
- # without that gate the hint fires on most fully-rendered element-heavy pages (measured 76% of prompts)
+ stats_text += 'Page appears empty - if unexpected, wait briefly or reload before concluding content is missing - '
+ # Skeleton screen: low text density only means "loading" while requests are actually in flight
elif (
self.browser_state.pending_network_requests
and page_stats['total_elements'] > 20
and page_stats['text_chars'] < page_stats['total_elements'] * 5
):
- stats_text += 'Page appears to show skeleton/placeholder content (still loading?) - '
+ pending_count = len(self.browser_state.pending_network_requests)
+ stats_text += (
+ f'{pending_count} network request(s) in flight and little text rendered - '
+ f'page may still be loading, consider a short wait - '
+ )
stats_text += f'{page_stats["links"]} links, {page_stats["interactive_elements"]} interactive, '
stats_text += f'{page_stats["iframes"]} iframes'
if page_stats['shadow_open'] > 0 or page_stats['shadow_closed'] > 0:
diff --git a/tests/ci/test_action_blank_page.py b/tests/ci/test_action_blank_page.py
index 9f03d9e3c..ec54f399c 100644
--- a/tests/ci/test_action_blank_page.py
+++ b/tests/ci/test_action_blank_page.py
@@ -144,7 +144,7 @@ class TestSkeletonScreenDetection:
prompt = _make_prompt(state)
description = prompt._get_browser_state_description()
- assert 'skeleton' in description.lower() or 'placeholder' in description.lower(), (
+ assert 'still be loading' in description.lower(), (
f'Expected skeleton/placeholder warning in description, got:\n{description[:500]}'
)
@@ -163,7 +163,7 @@ class TestSkeletonScreenDetection:
f'({page_stats["total_elements"] * 5})'
)
# No skeleton warning in description
- assert 'skeleton' not in description.lower() and 'placeholder' not in description.lower(), (
+ assert 'still be loading' not in description.lower(), (
'Rich page should NOT produce a skeleton warning'
)