From 17eac6412d28402fcf386c9f5c8ddd50081daf26 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 5 Jun 2026 01:43:09 -0700 Subject: [PATCH] [eric] browser: derive the reuse host from the task text when the dispatch has no url param --- backend/apps/agents/browser/browser_agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/apps/agents/browser/browser_agent.py b/backend/apps/agents/browser/browser_agent.py index 134d5099..c2837529 100644 --- a/backend/apps/agents/browser/browser_agent.py +++ b/backend/apps/agents/browser/browser_agent.py @@ -1507,8 +1507,11 @@ async def run_browser_agents( reused = False if not browser_id and dashboard_id: + # the url param is often empty with the target buried in the task + # text; a url there still names the host we must not duplicate + host_src = url or next(iter(re.findall(r"https?://[^\s)\"'<>]+", task_text)), "") async with _card_pick_lock: - browser_id = _find_reusable_card(dashboard_id, url, parent_session_id) + browser_id = _find_reusable_card(dashboard_id, host_src, parent_session_id) if browser_id: reused = True else: