do not clean up workflow in a task v2 block (#1771)

This commit is contained in:
Shuchang Zheng
2025-02-17 02:40:47 +08:00
committed by GitHub
parent 7e74ecc1c7
commit c846d3871b
3 changed files with 18 additions and 12 deletions

View File

@@ -352,6 +352,7 @@ class ForgeAgent:
detailed_output,
) = await self.initialize_execution_state(task, step, workflow_run, browser_session_id)
# mark step as completed and mark task as completed
if (
not task.navigation_goal
and not task.data_extraction_goal
@@ -359,7 +360,10 @@ class ForgeAgent:
and not task.terminate_criterion
):
# most likely a GOTO_URL task block
# mark step as completed and mark task as completed
page = await browser_state.must_get_working_page()
current_url = page.url
if current_url.rstrip("/") != task.url.rstrip("/"):
await page.goto(task.url)
step = await self.update_step(
step, status=StepStatus.completed, is_last=True, output=AgentStepOutput(action_results=[])
)