dbeadd8ab1
Check Cross-Plugin Imports / check (push) Has been cancelled
- F-CTX: app/ai/context_builder.py (282 lines) — build_agent_context() + ReActSystemPromptBuilder - F-STR: app/ai/agent_stream.py (155 lines) — stream_react_loop() with SSE events (step, status, done, error) - F-DEF: AgentDefinition fields added (temperature, max_tokens, max_steps, trace_mode, skill_ids, trigger_config, ai_use_case_metadata) + migration 0122 - F-SKILL: app/ai/skill_registry.py (82 lines) — SkillDefinition + SkillRegistry singleton - F-TOOL: app/ai/agent_tools.py (117 lines) — get_agent_tools() with permission intersection - Skill CRUD routes: app/plugins/builtins/automation/skill_routes.py - Tests: test_skill_registry.py (97 lines), test_agent_tools.py (219 lines) - All Python compile checks pass, tests require PostgreSQL (infra issue, not code bug)
67 lines
2.1 KiB
Python
67 lines
2.1 KiB
Python
"""Add Phase F fields to automation_agent_definitions.
|
|
|
|
Adds temperature, max_tokens, max_steps, trace_mode, skill_ids,
|
|
trigger_config, and ai_use_case_metadata to support the Phase F
|
|
context-builder, SSE streaming, and AI-use-case features.
|
|
|
|
Revision ID: 0122
|
|
Revises: 0121
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects.postgresql import JSONB
|
|
|
|
revision = "0122"
|
|
down_revision = "0121"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"automation_agent_definitions",
|
|
sa.Column("temperature", sa.Float, nullable=False, server_default="0.3"),
|
|
)
|
|
op.add_column(
|
|
"automation_agent_definitions",
|
|
sa.Column("max_tokens", sa.Integer, nullable=False, server_default="1000"),
|
|
)
|
|
op.add_column(
|
|
"automation_agent_definitions",
|
|
sa.Column("max_steps", sa.Integer, nullable=False, server_default="20"),
|
|
)
|
|
op.add_column(
|
|
"automation_agent_definitions",
|
|
sa.Column(
|
|
"trace_mode", sa.String(20), nullable=False, server_default="standard"
|
|
),
|
|
)
|
|
op.add_column(
|
|
"automation_agent_definitions",
|
|
sa.Column("skill_ids", JSONB, nullable=False, server_default=sa.text("'[]'::jsonb")),
|
|
)
|
|
op.add_column(
|
|
"automation_agent_definitions",
|
|
sa.Column("trigger_config", JSONB, nullable=False, server_default=sa.text("'{}'::jsonb")),
|
|
)
|
|
op.add_column(
|
|
"automation_agent_definitions",
|
|
sa.Column(
|
|
"ai_use_case_metadata",
|
|
JSONB,
|
|
nullable=False,
|
|
server_default=sa.text("'{}'::jsonb"),
|
|
),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("automation_agent_definitions", "ai_use_case_metadata")
|
|
op.drop_column("automation_agent_definitions", "trigger_config")
|
|
op.drop_column("automation_agent_definitions", "skill_ids")
|
|
op.drop_column("automation_agent_definitions", "trace_mode")
|
|
op.drop_column("automation_agent_definitions", "max_steps")
|
|
op.drop_column("automation_agent_definitions", "max_tokens")
|
|
op.drop_column("automation_agent_definitions", "temperature")
|