Skip to content

The agent that grows with you

fix(browser): text-only header no longer tells vision models they cannot see images (#131568)

teknium16e573f374686
diff --git a/tests/tools/test_browser_use_cli.py b/tests/tools/test_browser_use_cli.py
index 55195988c4e..7b6395b45d2 100644
--- a/tests/tools/test_browser_use_cli.py
+++ b/tests/tools/test_browser_use_cli.py
@@ -735,6 +735,21 @@ class TestHeaderVariants:
)
assert bu_cli._description_header() == bu_cli._HEADER_BASE + bu_cli._HEADER_TEXT_ONLY
+ def test_text_only_header_claims_nothing_about_model_vision(self, monkeypatch):
+ """The text-only gate measures whether screenshots ride back in TOOL RESULTS, not whether
+ the model has vision; a vision-capable model on a provider without tool-result media must
+ not be told it "cannot view images" (#131568: it then skipped a user-attached image)."""
+ monkeypatch.setattr(
+ "tools.vision_tools._should_use_native_vision_fast_path", lambda: False
+ )
+ monkeypatch.setattr(
+ "tools.browser_tool_lightpanda_fallback.lightpanda_engine_status", lambda: (False, "")
+ )
+ header = bu_cli._description_header().lower()
+ assert "your model cannot" not in header
+ assert "cannot view images" not in header
+ assert "tool's results" in header and "text-first" in header
+
class TestSkillTextDescription:
"""The schema description is fully pinned: header + _HELPERS_DIGEST.
diff --git a/tools/browser_use_cli.py b/tools/browser_use_cli.py
index b26260e8690..159de1b3d90 100644
--- a/tools/browser_use_cli.py
+++ b/tools/browser_use_cli.py
@@ -808,10 +808,16 @@ _HEADER_VISION = (
"with your own vision — never send browser screenshots to a separate vision tool."
)
+# Chosen when screenshots cannot ride back inside THIS tool's results (provider/model
+# rejects tool-result media, or routing is not ``native``). That is a transport fact
+# about tool results, not a verdict on the model's vision: a vision-capable model still
+# sees images the user attaches to the conversation, so the header must never say
+# "your model cannot view images" — models quote that against themselves (#131568).
_HEADER_TEXT_ONLY = (
- " Your model cannot view images, so work text-first: page_info() for state, js() for "
- "reading/extracting DOM text, fill_input(selector, text) for inputs, and "
- "js(\"document.querySelector('…').click()\") for clicks — skip the screenshot-driven workflow described below."
+ " Screenshots will not reach you through this tool's results in this setup, so work text-first: "
+ "page_info() for state, js() for reading/extracting DOM text, fill_input(selector, text) for inputs, and "
+ "js(\"document.querySelector('…').click()\") for clicks — skip the screenshot-driven workflow described below. "
+ "This says nothing about images the user attaches to the conversation."
)
# Appended when the local engine is Lightpanda: no graphical renderer, and one CDP