fix workflow_runs.code_gen to enforce code generate only for task v2 block run (#3597)

This commit is contained in:
Shuchang Zheng
2025-10-02 16:06:54 -07:00
committed by GitHub
parent a7025fc9b7
commit 7e5c4b3a03
14 changed files with 53 additions and 37 deletions

View File

@@ -1700,6 +1700,7 @@ class AgentDB:
run_with: str | None = None,
debug_session_id: str | None = None,
ai_fallback: bool | None = None,
code_gen: bool | None = None,
) -> WorkflowRun:
try:
async with self.Session() as session:
@@ -1721,6 +1722,7 @@ class AgentDB:
run_with=run_with,
debug_session_id=debug_session_id,
ai_fallback=ai_fallback,
code_gen=code_gen,
)
session.add(workflow_run)
await session.commit()

View File

@@ -292,6 +292,7 @@ class WorkflowRunModel(Base):
run_with = Column(String, nullable=True) # 'agent' or 'code'
debug_session_id: Column = Column(String, nullable=True)
ai_fallback = Column(Boolean, nullable=True)
code_gen = Column(Boolean, nullable=True)
queued_at = Column(DateTime, nullable=True)
started_at = Column(DateTime, nullable=True)

View File

@@ -328,6 +328,7 @@ def convert_to_workflow_run(
if workflow_run_model.script_run
else None,
run_with=workflow_run_model.run_with,
code_gen=workflow_run_model.code_gen,
)