Skip to content

fix: cleared browser-use context #4

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

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ async def run_browser_task_async(task_id, url, action):
"steps": [],
}

# Reset browser context to ensure a clean state
await reset_browser_context()

# Check browser health
if not await check_browser_health():
task_store[task_id]["status"] = "failed"
Expand Down Expand Up @@ -154,7 +157,7 @@ async def done_callback(history):

# Use the existing browser context with callbacks
agent = Agent(
task=action,
task=f"First, navigate to {url}. Then, {action}",
llm=llm,
browser_context=context,
register_new_step_callback=step_callback,
Expand Down