Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Save last state in message manager
Magnus Müller3c5fbe9eb56b
diff --git a/browser_use/agent/message_manager/service.py b/browser_use/agent/message_manager/service.pyindex 576546428..baf0931a4 100644--- a/browser_use/agent/message_manager/service.py+++ b/browser_use/agent/message_manager/service.py@@ -125,6 +125,7 @@ class MessageManager:self.sensitive_data_description = ''self.available_file_paths = available_file_pathsself.use_thinking = use_thinking+ self.last_input_messages = []# Only initialize messages if state is emptyif len(self.state.history.messages) == 0:self._init_messages()@@ -392,8 +393,8 @@ Next Goal: {model_output.current_state.next_goal}# Log message history for debugginglogger.debug(self._log_history_lines())-- return [m.message for m in self.state.history.messages]+ self.last_input_messages = [m.message for m in self.state.history.messages]+ return self.last_input_messagesdef _add_message_with_type(self,