remove include history flag from workflow run model (#2354)
Co-authored-by: lawyzheng <lawyzheng1106@gmail.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""remove_include_history_flag_out_of_workflow_run_block
|
||||
|
||||
Revision ID: ecdba16ef45c
|
||||
Revises: d90177b2b935
|
||||
Create Date: 2025-05-15 19:19:37.737352+00:00
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "ecdba16ef45c"
|
||||
down_revision: Union[str, None] = "d90177b2b935"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index(
|
||||
op.f("ix_persistent_browser_sessions_runnable_id"), "persistent_browser_sessions", ["runnable_id"], unique=False
|
||||
)
|
||||
op.drop_column("workflow_run_blocks", "include_action_history_in_verification")
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column(
|
||||
"workflow_run_blocks",
|
||||
sa.Column("include_action_history_in_verification", sa.BOOLEAN(), autoincrement=False, nullable=True),
|
||||
)
|
||||
op.drop_index(op.f("ix_persistent_browser_sessions_runnable_id"), table_name="persistent_browser_sessions")
|
||||
# ### end Alembic commands ###
|
||||
@@ -2566,7 +2566,6 @@ class AgentDB:
|
||||
wait_sec: int | None = None,
|
||||
description: str | None = None,
|
||||
block_workflow_run_id: str | None = None,
|
||||
include_action_history_in_verification: bool | None = None,
|
||||
) -> WorkflowRunBlock:
|
||||
async with self.Session() as session:
|
||||
workflow_run_block = (
|
||||
@@ -2607,8 +2606,6 @@ class AgentDB:
|
||||
workflow_run_block.description = description
|
||||
if block_workflow_run_id:
|
||||
workflow_run_block.block_workflow_run_id = block_workflow_run_id
|
||||
if include_action_history_in_verification is not None:
|
||||
workflow_run_block.include_action_history_in_verification = include_action_history_in_verification
|
||||
await session.commit()
|
||||
await session.refresh(workflow_run_block)
|
||||
else:
|
||||
|
||||
@@ -533,7 +533,6 @@ class WorkflowRunBlockModel(Base):
|
||||
|
||||
workflow_run_block_id = Column(String, primary_key=True, default=generate_workflow_run_block_id)
|
||||
workflow_run_id = Column(String, nullable=False)
|
||||
include_action_history_in_verification = Column(Boolean, default=False, nullable=True)
|
||||
# this is the inner workflow run id of the taskv2 block
|
||||
block_workflow_run_id = Column(String, nullable=True)
|
||||
parent_workflow_run_block_id = Column(String, nullable=True)
|
||||
|
||||
@@ -412,7 +412,6 @@ def convert_to_workflow_run_block(
|
||||
body=workflow_run_block_model.body,
|
||||
created_at=workflow_run_block_model.created_at,
|
||||
modified_at=workflow_run_block_model.modified_at,
|
||||
include_action_history_in_verification=workflow_run_block_model.include_action_history_in_verification,
|
||||
)
|
||||
if task:
|
||||
block.url = task.url
|
||||
@@ -422,5 +421,6 @@ def convert_to_workflow_run_block(
|
||||
block.data_schema = task.extracted_information_schema
|
||||
block.terminate_criterion = task.terminate_criterion
|
||||
block.complete_criterion = task.complete_criterion
|
||||
block.include_action_history_in_verification = task.include_action_history_in_verification
|
||||
|
||||
return block
|
||||
|
||||
@@ -545,7 +545,6 @@ class BaseTaskBlock(Block):
|
||||
workflow_run_block_id=workflow_run_block_id,
|
||||
task_id=task.task_id,
|
||||
organization_id=organization_id,
|
||||
include_action_history_in_verification=self.include_action_history_in_verification,
|
||||
)
|
||||
current_running_task = task
|
||||
organization = await app.DATABASE.get_organization(organization_id=workflow_run.organization_id)
|
||||
|
||||
Reference in New Issue
Block a user