-
Notifications
You must be signed in to change notification settings - Fork 8.2k
enable StorageStateWatchdog if user_data_dir provided #2987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable StorageStateWatchdog if user_data_dir provided #2987
Conversation
Agent Task Evaluation Results: 2/4 (50%)View detailed results
Check the evaluate-tasks job for detailed task execution logs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 1 file
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
# Initialize StorageStateWatchdog conditionally | ||
# Enable when user provides either storage_state or user_data_dir (indicating they want persistence) | ||
should_enable_storage_state = ( | ||
self.browser_profile.storage_state is not None or self.browser_profile.user_data_dir is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling the watchdog when only user_data_dir is set starts monitoring but cannot save/load without a storage_state path, adding overhead without effect. Consider deriving a default path from user_data_dir or gating enablement on storage_state.
Prompt for AI agents
Address the following comment on browser_use/browser/session.py at line 1003:
<comment>Enabling the watchdog when only user_data_dir is set starts monitoring but cannot save/load without a storage_state path, adding overhead without effect. Consider deriving a default path from user_data_dir or gating enablement on storage_state.</comment>
<file context>
@@ -997,14 +997,27 @@ async def attach_all_watchdogs(self) -> None:
+ # Initialize StorageStateWatchdog conditionally
+ # Enable when user provides either storage_state or user_data_dir (indicating they want persistence)
+ should_enable_storage_state = (
+ self.browser_profile.storage_state is not None or self.browser_profile.user_data_dir is not None
+ )
+
</file context>
Auto-generated PR for: enable StorageStateWatchdog if user_data_dir provided
Summary by cubic
Enable StorageStateWatchdog when storage_state or user_data_dir is set, so sessions with persistence configured save storage on shutdown with safe defaults. Adds clear debug logs to show when it’s enabled.