From 39208a3e194fd1bc3ccda29979c8578c8e9b2b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20M=C3=BCller?= <67061560+MagMueller@users.noreply.github.com> Date: Tue, 8 Jul 2025 23:28:15 +0200 Subject: [PATCH] Update browser_use/controller/service.py Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- browser_use/controller/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py index b3aeed480..d493dcbba 100644 --- a/browser_use/controller/service.py +++ b/browser_use/controller/service.py @@ -375,7 +375,7 @@ Only use this for specific queries for information retrieval from the page. Don' # replace multiple sequential \n with a single \n content = re.sub(r'\n+', '\n', content) - # limit to 000 characters - remove text in the middle this is approx 20000 tokens + # limit to 30000 characters - remove text in the middle (≈15000 tokens) max_chars = 30000 if len(content) > max_chars: logger.info(f'Content is too long, removing middle {len(content) - max_chars} characters')