feat(agents): Add task assignment and comments functionality

This commit is contained in:
Abhimanyu Saharan
2026-02-04 18:13:17 +05:30
parent 8078580996
commit 7892dfad7c
9 changed files with 1882 additions and 6 deletions

View File

@@ -0,0 +1,36 @@
"""add task assigned agent
Revision ID: 8045fbfb157f
Revises: 6df47d330227
Create Date: 2026-02-04 17:28:57.465934
"""
from __future__ import annotations
from alembic import op
# revision identifiers, used by Alembic.
revision = '8045fbfb157f'
down_revision = '6df47d330227'
branch_labels = None
depends_on = None
def upgrade() -> None:
op.execute(
"ALTER TABLE tasks ADD COLUMN IF NOT EXISTS assigned_agent_id UUID"
)
op.execute(
"ALTER TABLE tasks ADD CONSTRAINT IF NOT EXISTS tasks_assigned_agent_id_fkey "
"FOREIGN KEY (assigned_agent_id) REFERENCES agents(id)"
)
def downgrade() -> None:
op.execute(
"ALTER TABLE tasks DROP CONSTRAINT IF EXISTS tasks_assigned_agent_id_fkey"
)
op.execute(
"ALTER TABLE tasks DROP COLUMN IF EXISTS assigned_agent_id"
)

View File

@@ -0,0 +1,29 @@
"""add task comments index
Revision ID: b9d22e2a4d50
Revises: 8045fbfb157f
Create Date: 2026-02-04 17:32:06.204331
"""
from __future__ import annotations
from alembic import op
# revision identifiers, used by Alembic.
revision = 'b9d22e2a4d50'
down_revision = '8045fbfb157f'
branch_labels = None
depends_on = None
def upgrade() -> None:
op.execute(
"CREATE INDEX IF NOT EXISTS ix_activity_events_task_comment "
"ON activity_events (task_id, created_at) "
"WHERE event_type = 'task.comment'"
)
def downgrade() -> None:
op.execute("DROP INDEX IF EXISTS ix_activity_events_task_comment")