script run - fix post action screenshot mismatch issue (#3346)
This commit is contained in:
@@ -216,7 +216,7 @@ class SkyvernPage:
|
|||||||
task_id=context.task_id,
|
task_id=context.task_id,
|
||||||
step_id=context.step_id,
|
step_id=context.step_id,
|
||||||
step_order=0, # Will be updated by the system if needed
|
step_order=0, # Will be updated by the system if needed
|
||||||
action_order=0, # Will be updated by the system if needed
|
action_order=context.action_order, # Will be updated by the system if needed
|
||||||
intention=intention,
|
intention=intention,
|
||||||
reasoning=f"Auto-generated action for {action_type.value}",
|
reasoning=f"Auto-generated action for {action_type.value}",
|
||||||
text=text,
|
text=text,
|
||||||
@@ -234,7 +234,7 @@ class SkyvernPage:
|
|||||||
task_id=context.task_id,
|
task_id=context.task_id,
|
||||||
step_id=context.step_id,
|
step_id=context.step_id,
|
||||||
step_order=0,
|
step_order=0,
|
||||||
action_order=0,
|
action_order=context.action_order,
|
||||||
intention=intention,
|
intention=intention,
|
||||||
reasoning=f"Auto-generated action for {action_type.value}",
|
reasoning=f"Auto-generated action for {action_type.value}",
|
||||||
data_extraction_goal=kwargs.get("prompt"),
|
data_extraction_goal=kwargs.get("prompt"),
|
||||||
@@ -245,6 +245,7 @@ class SkyvernPage:
|
|||||||
)
|
)
|
||||||
|
|
||||||
created_action = await app.DATABASE.create_action(action)
|
created_action = await app.DATABASE.create_action(action)
|
||||||
|
context.action_order += 1
|
||||||
return created_action
|
return created_action
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class SkyvernContext:
|
|||||||
max_screenshot_scrolls: int | None = None
|
max_screenshot_scrolls: int | None = None
|
||||||
script_id: str | None = None
|
script_id: str | None = None
|
||||||
script_revision_id: str | None = None
|
script_revision_id: str | None = None
|
||||||
|
action_order: int = 0
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f"SkyvernContext(request_id={self.request_id}, organization_id={self.organization_id}, task_id={self.task_id}, step_id={self.step_id}, workflow_id={self.workflow_id}, workflow_run_id={self.workflow_run_id}, task_v2_id={self.task_v2_id}, max_steps_override={self.max_steps_override}, run_id={self.run_id})"
|
return f"SkyvernContext(request_id={self.request_id}, organization_id={self.organization_id}, task_id={self.task_id}, step_id={self.step_id}, workflow_id={self.workflow_id}, workflow_run_id={self.workflow_run_id}, task_v2_id={self.task_v2_id}, max_steps_override={self.max_steps_override}, run_id={self.run_id})"
|
||||||
|
|||||||
@@ -306,6 +306,8 @@ async def _create_workflow_block_run_and_task(
|
|||||||
status=StepStatus.running,
|
status=StepStatus.running,
|
||||||
)
|
)
|
||||||
step_id = step.step_id
|
step_id = step.step_id
|
||||||
|
# reset the action order to 0
|
||||||
|
context.action_order = 0
|
||||||
|
|
||||||
# Update workflow run block with task_id
|
# Update workflow run block with task_id
|
||||||
await app.DATABASE.update_workflow_run_block(
|
await app.DATABASE.update_workflow_run_block(
|
||||||
|
|||||||
Reference in New Issue
Block a user