-
Notifications
You must be signed in to change notification settings - Fork 777
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
Persistent browser sessions #1391
Open
satansdeer
wants to merge
33
commits into
Skyvern-AI:main
Choose a base branch
from
satansdeer:maksimi/persistent-browser-session
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Persistent browser sessions #1391
satansdeer
wants to merge
33
commits into
Skyvern-AI:main
from
satansdeer:maksimi/persistent-browser-session
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
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 6b2077e in 1 minute and 12 seconds
More details
- Looked at
979
lines of code in18
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. run_tests.sh:13
- Draft comment:
Add a newline at the end of the file to follow best practices. - Reason this comment was not posted:
Confidence changes required:10%
Therun_tests.sh
script is missing a newline at the end of the file. This is a minor issue but it's a good practice to end files with a newline to avoid potential issues with some tools and editors.
2. skyvern-frontend/src/initDevCommands.ts:18
- Draft comment:
The non-null assertion operator!
is unnecessary here sinceenvCredential
is already checked for nullability. Consider removing it for clarity. - Reason this comment was not posted:
Confidence changes required:20%
IninitDevCommands.ts
, theenvCredential!
is used with a non-null assertion operator. This is unnecessary because the code already checks ifenvCredential
is not set and returns early. The non-null assertion operator can be removed to improve code clarity.
3. skyvern-frontend/src/initDevCommands.ts:45
- Draft comment:
The non-null assertion operator!
is unnecessary here sinceenvCredential
is already checked for nullability. Consider removing it for clarity. This applies to thelistBrowserSessions
function as well. - Reason this comment was not posted:
Confidence changes required:20%
IninitDevCommands.ts
, theenvCredential!
is used with a non-null assertion operator. This is unnecessary because the code already checks ifenvCredential
is not set and returns early. The non-null assertion operator can be removed to improve code clarity. This issue is also present in thelistBrowserSessions
function.
4. skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx:92
- Draft comment:
The double casting tounknown
and then tostring
is unnecessary. Simplify by directly casting tostring
. - Reason this comment was not posted:
Confidence changes required:20%
InRunWorkflowForm.tsx
, thebrowserSessionId
is retrieved fromwindow.devCommands
and cast tounknown
and then tostring
. This double casting is unnecessary and can be simplified by directly casting tostring
.
5. skyvern/forge/sdk/routes/test_browser_sessions_routes.py:27
- Draft comment:
Consider usingdatetime
instead oftime.time()
for setting the JWT expiration to handle timezones and time precision more effectively. - Reason this comment was not posted:
Confidence changes required:30%
Intest_browser_sessions_routes.py
, thesetup_auth_mocks
function usestime.time()
to set the expiration time for the JWT. This can lead to issues with time synchronization across systems. It's better to usedatetime
for more precise control over time and timezone handling.
6. skyvern/forge/sdk/routes/test_browser_sessions_routes.py:29
- Draft comment:
Ensuresettings.SECRET_KEY
is securely managed and not hardcoded or exposed in the codebase. - Reason this comment was not posted:
Confidence changes required:30%
Intest_browser_sessions_routes.py
, thex_api_key
is generated usingjwt.encode
withsettings.SECRET_KEY
. Ensure thatsettings.SECRET_KEY
is securely managed and not hardcoded or exposed in the codebase.
7. skyvern/forge/sdk/workflow/models/block.py:439
- Draft comment:
Ensure that settingclose_browser_on_completion=False
is the desired behavior for all cases whereexecute_step
is called, as this change supports persistent browser sessions. - Reason this comment was not posted:
Confidence changes required:30%
Inblock.py
, theclose_browser_on_completion
parameter is set toFalse
in theexecute_step
method. This change is consistent with the PR's intent to support persistent browser sessions, but it should be verified that this behavior is desired in all cases whereexecute_step
is called.
8. skyvern/forge/sdk/workflow/service.py:125
- Draft comment:
Consider implementing a timeout reset for reusable browser sessions if a timeout mechanism exists, to keep the session alive during the workflow run. - Reason this comment was not posted:
Confidence changes required:30%
Inservice.py
, thesetup_workflow_run
method checks for a reusable browser session but does not reset its timeout. If sessions have a timeout mechanism, consider implementing a reset to keep the session alive during the workflow run.
Workflow ID: wflow_ZaNBZnAESCKepMob
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
satansdeer
force-pushed
the
maksimi/persistent-browser-session
branch
from
December 17, 2024 17:23
164bb41
to
33c15ac
Compare
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.
Important
Introduce persistent browser sessions with management, API endpoints, and workflow integration, including frontend and backend support.
PersistentSessionsManager
to manage browser sessions inpersistent_sessions_manager.py
.BrowserManager
inbrowser_manager.py
to use persistent sessions if available.browser_session_id
toSkyvernContext
inskyvern_context.py
.agent_protocol.py
to create, list, and retrieve browser sessions.test_browser_sessions_routes.py
.execute_workflow
inservice.py
to usebrowser_session_id
.RunWorkflowForm.tsx
to includebrowser_session_id
in requests.initDevCommands.ts
to create and list browser sessions from the frontend.main.tsx
.test_persistent_sessions_manager.py
to test session management.run_tests.sh
to facilitate running tests.This description was created by for 6b2077e. It will automatically update as commits are pushed.