-
Notifications
You must be signed in to change notification settings - Fork 798
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
Use persistent browser session in runnables #1510
Merged
wintonzheng
merged 59 commits into
Skyvern-AI:main
from
satansdeer:maksimi/use-persistent-browser-session
Jan 9, 2025
Merged
Use persistent browser session in runnables #1510
wintonzheng
merged 59 commits into
Skyvern-AI:main
from
satansdeer:maksimi/use-persistent-browser-session
Jan 9, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
satansdeer
changed the title
maksimi/use persistent browser session
Use persistent browser session in runnables
Jan 7, 2025
Co-authored-by: Shuchang Zheng <shu@skyvern.com>
…ent-browser-session
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.
👍 Looks good to me! Reviewed everything up to 265c9b1 in 1 minute and 38 seconds
More details
- Looked at
1152
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. skyvern/webeye/browser_manager.py:70
- Draft comment:
Consider refactoring the logic for handling browser sessions to reduce duplication. The code for creating, occupying, and releasing sessions is repeated in multiple places, which can be consolidated for better maintainability. - Reason this comment was not posted:
Confidence changes required:50%
The code inbrowser_manager.py
andpersistent_sessions_manager.py
has a lot of repeated logic for handling browser sessions, especially around creating, occupying, and releasing sessions. This could be refactored to reduce duplication and improve maintainability.
2. skyvern/webeye/browser_manager.py:126
- Draft comment:
The logic for handling browser sessions inget_or_create_for_task
andget_or_create_for_workflow_run
is similar. Consider refactoring to reduce code duplication. - Reason this comment was not posted:
Confidence changes required:50%
Theget_or_create_for_task
andget_or_create_for_workflow_run
methods inbrowser_manager.py
have similar logic for handling browser sessions. This could be refactored to reduce code duplication.
3. skyvern/webeye/persistent_sessions_manager.py:165
- Draft comment:
The try-except block inclose_session
handlesTargetClosedError
and generic exceptions. Consider adding more context to the log messages to aid in debugging. - Reason this comment was not posted:
Confidence changes required:33%
Theclose_session
method inpersistent_sessions_manager.py
has a try-except block that handlesTargetClosedError
and a generic exception. This is good for robustness, but the logging could be improved to provide more context about the error.
Workflow ID: wflow_HJezITDQvZAjZrEA
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
wintonzheng
reviewed
Jan 9, 2025
wintonzheng
reviewed
Jan 9, 2025
wintonzheng
reviewed
Jan 9, 2025
wintonzheng
reviewed
Jan 9, 2025
wintonzheng
approved these changes
Jan 9, 2025
Co-authored-by: Shuchang Zheng <shu@skyvern.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #1497
Testing
Run
python scripts/test_persistent_browsers.py
it will launch testing CLI.In the testing CLI:
The task should run with browser session id and occupy/release the browser session
Important
Introduces persistent browser sessions for tasks and workflows, enabling session reuse across runs by updating session management and execution logic.
test_persistent_browsers.py
, allowing tasks and workflows to reuse browser sessions.browser_session_id
parameter to functions inagent.py
,async_executor.py
, andagent_protocol.py
to support session reuse.BrowserManager
andPersistentSessionsManager
to handle session creation, occupation, and release.get_or_create_for_task()
andget_or_create_for_workflow_run()
inbrowser_manager.py
.cleanup_for_task()
andcleanup_for_workflow_run()
inbrowser_manager.py
.execute_task()
,execute_workflow()
, andexecute_cruise()
inasync_executor.py
to usebrowser_session_id
.execute_step()
inagent.py
to handlebrowser_session_id
for task execution.create_agent_task()
andexecute_workflow()
inagent_protocol.py
to passbrowser_session_id
.browser_session_id
toTaskRequest
intasks.py
andCruiseRequest
inobservers.py
.This description was created by for 265c9b1. It will automatically update as commits are pushed.