[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

@ -553,7 +553,9 @@ async def run_task_v2_helper(
current_url: str | None = None
browser_state = await app.BROWSER_MANAGER.get_or_create_for_workflow_run(
workflow_run=workflow_run, browser_session_id=browser_session_id
workflow_run=workflow_run,
browser_session_id=browser_session_id,
browser_profile_id=workflow_run.browser_profile_id,
)
page = await browser_state.get_working_page()
@ -609,7 +611,9 @@ async def run_task_v2_helper(
# Always ensure browser_state is available at the start of the loop
fallback_url = settings.TASK_BLOCKED_SITE_FALLBACK_URL
browser_state = await app.BROWSER_MANAGER.get_or_create_for_workflow_run(
workflow_run=workflow_run, browser_session_id=browser_session_id
workflow_run=workflow_run,
browser_session_id=browser_session_id,
browser_profile_id=workflow_run.browser_profile_id,
)
fallback_occurred = False
@ -623,6 +627,7 @@ async def run_task_v2_helper(
script_id=task_v2.script_id,
organization_id=organization_id,
extra_http_headers=task_v2.extra_http_headers,
browser_profile_id=workflow_run.browser_profile_id,
)
else:
await browser_state.navigate_to_url(page, url)
@ -895,6 +900,7 @@ async def run_task_v2_helper(
workflow_run=workflow_run,
url=url,
browser_session_id=browser_session_id,
browser_profile_id=workflow_run.browser_profile_id,
)
scraped_page = await scrape_website(
browser_state,