Skip to content

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

Improve error logging in message manager by appending ellipsis to truncated error messages for better clarity in action results.

Magnus Müllereda514036328
diff --git a/browser_use/agent/message_manager/service.py b/browser_use/agent/message_manager/service.py
index 093bdee7a..f7433be74 100644
--- a/browser_use/agent/message_manager/service.py
+++ b/browser_use/agent/message_manager/service.py
@@ -394,8 +394,8 @@ My next action is to click on the iPhone link at index [4] to navigate to Apple'
logger.debug(f'Added extracted_content to action_results: {action_result.extracted_content}')
if action_result.error:
- action_results += f'Action {idx + 1}/{result_len} response: {action_result.error[:200]}\n'
- logger.debug(f'Added error to action_results: {action_result.error[:200]}')
+ action_results += f'Action {idx + 1}/{result_len} response: {action_result.error[:200]}...\n'
+ logger.debug(f'Added error to action_results: {action_result.error[:200]}...')
self.agent_history_description += f"""## Step {step_number}
Step evaluation: {model_output.current_state.evaluation_previous_goal}