only run script when generate_script is true (#3491)

This commit is contained in:
Shuchang Zheng
2025-09-21 02:45:23 -04:00
committed by GitHub
parent 770be508e3
commit 9a9ee01253
9 changed files with 186 additions and 142 deletions

View File

@@ -1676,6 +1676,7 @@ class AgentDB:
webhook_failure_reason: str | None = None,
ai_fallback_triggered: bool | None = None,
job_id: str | None = None,
run_with: str | None = None,
) -> WorkflowRun:
async with self.Session() as session:
workflow_run = (
@@ -1698,6 +1699,8 @@ class AgentDB:
workflow_run.script_run = {"ai_fallback_triggered": ai_fallback_triggered}
if job_id:
workflow_run.job_id = job_id
if run_with:
workflow_run.run_with = run_with
await session.commit()
await session.refresh(workflow_run)
await save_workflow_run_logs(workflow_run_id)

View File

@@ -308,6 +308,7 @@ def convert_to_workflow_run(
script_run=ScriptRunResponse.model_validate(workflow_run_model.script_run)
if workflow_run_model.script_run
else None,
run_with=workflow_run_model.run_with,
)