[SKY-6974] Browser Profiles [2/3] Marc/backend browser session profiles (#3923)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
Marc Kelechava 2025-11-06 01:24:39 -08:00 committed by GitHub
parent f0172a22df
commit 3db5ec6cd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 662 additions and 27 deletions

View file

@ -645,7 +645,10 @@ class BaseTaskBlock(Block):
# the first task block will create the browser state and do the navigation
try:
browser_state = await app.BROWSER_MANAGER.get_or_create_for_workflow_run(
workflow_run=workflow_run, url=self.url, browser_session_id=browser_session_id
workflow_run=workflow_run,
url=self.url,
browser_session_id=browser_session_id,
browser_profile_id=workflow_run.browser_profile_id,
)
working_page = await browser_state.get_working_page()
if not working_page:
@ -1586,6 +1589,7 @@ async def wrapper():
workflow_run=workflow_run,
url=None, # Code block doesn't need to navigate to a URL initially
browser_session_id=browser_session_id,
browser_profile_id=workflow_run.browser_profile_id,
)
# Ensure the browser state has a working page
await browser_state.check_and_fix_state(
@ -1595,6 +1599,7 @@ async def wrapper():
organization_id=workflow_run.organization_id,
extra_http_headers=workflow_run.extra_http_headers,
browser_address=workflow_run.browser_address,
browser_profile_id=workflow_run.browser_profile_id,
)
except Exception as e:
LOG.exception(