Skip to content

Commit fbe8262

Browse files
authored
Merge pull request #4 from co-browser/fix/browser-context
fix: cleared browser-use context
2 parents 37e88ca + daf7a8f commit fbe8262

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/server.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ async def run_browser_task_async(task_id, url, action):
106106
"steps": [],
107107
}
108108

109+
# Reset browser context to ensure a clean state
110+
await reset_browser_context()
111+
109112
# Check browser health
110113
if not await check_browser_health():
111114
task_store[task_id]["status"] = "failed"
@@ -154,7 +157,7 @@ async def done_callback(history):
154157

155158
# Use the existing browser context with callbacks
156159
agent = Agent(
157-
task=action,
160+
task=f"First, navigate to {url}. Then, {action}",
158161
llm=llm,
159162
browser_context=context,
160163
register_new_step_callback=step_callback,

0 commit comments

Comments
 (0)