feat: Browser profile testing & login-free workflow support — backend (#SKY-8012) (#4818)

Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
Celal Zamanoğlu
2026-02-20 02:23:32 +03:00
committed by GitHub
parent f8f9d2a17f
commit 4adaf8dd53
8 changed files with 1287 additions and 5 deletions

View File

@@ -816,6 +816,23 @@ class BaseTaskBlock(Block):
if working_page.url == "about:blank" and self.url:
await browser_state.navigate_to_url(page=working_page, url=self.url)
# When a browser profile is loaded, wait for the page to fully settle
# so that cookie-based authentication can redirect or restore the session
# BEFORE the agent starts interacting with the page.
if workflow_run.browser_profile_id:
LOG.info(
"Browser profile loaded — waiting for page to settle before agent acts",
browser_profile_id=workflow_run.browser_profile_id,
workflow_run_id=workflow_run.workflow_run_id,
)
try:
await working_page.wait_for_load_state("networkidle", timeout=10000)
except Exception:
LOG.debug(
"networkidle timeout after browser profile load (non-fatal)",
workflow_run_id=workflow_run.workflow_run_id,
)
except Exception as e:
LOG.exception(
"Failed to get browser state for first task",