Skip to content

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

Clean up unused import and remove trailing whitespace

codenoidd68d1f501934
diff --git a/browser_use/agent/message_manager/utils.py b/browser_use/agent/message_manager/utils.py
index fc616175c..ce9490124 100644
--- a/browser_use/agent/message_manager/utils.py
+++ b/browser_use/agent/message_manager/utils.py
@@ -3,7 +3,6 @@ from __future__ import annotations
import json
import logging
import os
-import re
from typing import Any, Optional, Type
from langchain_core.messages import (
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 40edfa575..50947781f 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -484,7 +484,7 @@ class Agent(Generic[Context]):
history_item = AgentHistory(model_output=model_output, result=result, state=state_history, metadata=metadata)
self.state.history.history.append(history_item)
-
+
THINK_TAGS = re.compile(r'<think>.*?</think>', re.DOTALL)
STRAY_CLOSE_TAG = re.compile(r'.*?</think>', re.DOTALL)