add flag for forcing code_gen for v2 task block runs (#3576)
This commit is contained in:
@@ -306,6 +306,7 @@ async def run_task_v2(
|
||||
request_id: str | None = None,
|
||||
max_steps_override: str | int | None = None,
|
||||
browser_session_id: str | None = None,
|
||||
code_gen: bool | None = None,
|
||||
) -> TaskV2:
|
||||
organization_id = organization.organization_id
|
||||
try:
|
||||
@@ -334,6 +335,7 @@ async def run_task_v2(
|
||||
request_id=request_id,
|
||||
max_steps_override=max_steps_override,
|
||||
browser_session_id=browser_session_id,
|
||||
code_gen=code_gen,
|
||||
)
|
||||
except TaskTerminationError as e:
|
||||
task_v2 = await mark_task_v2_as_terminated(
|
||||
@@ -390,6 +392,7 @@ async def run_task_v2_helper(
|
||||
request_id: str | None = None,
|
||||
max_steps_override: str | int | None = None,
|
||||
browser_session_id: str | None = None,
|
||||
code_gen: bool | None = None,
|
||||
) -> tuple[Workflow, WorkflowRun, TaskV2] | tuple[None, None, TaskV2]:
|
||||
organization_id = organization.organization_id
|
||||
task_v2_id = task_v2.observer_cruise_id
|
||||
@@ -772,6 +775,7 @@ async def run_task_v2_helper(
|
||||
block_result = await block.execute_safe(
|
||||
workflow_run_id=workflow_run_id,
|
||||
organization_id=organization_id,
|
||||
code_gen=code_gen,
|
||||
)
|
||||
task_history_record["status"] = str(block_result.status)
|
||||
if block_result.failure_reason:
|
||||
@@ -900,10 +904,11 @@ async def run_task_v2_helper(
|
||||
context=context,
|
||||
screenshots=completion_screenshots,
|
||||
)
|
||||
if task_v2.run_with == "code": # TODO(jdo): not sure about this one...
|
||||
if task_v2.run_with == "code" or code_gen: # TODO(jdo): not sure about this one...
|
||||
await app.WORKFLOW_SERVICE.generate_script_if_needed(
|
||||
workflow=workflow,
|
||||
workflow_run=workflow_run,
|
||||
code_gen=code_gen,
|
||||
)
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user