refactor: unify skills+cli runtime and streamline ag-ui flow
This commit is contained in:
@@ -4,8 +4,8 @@ from uuid import uuid4
|
||||
import pytest
|
||||
|
||||
from models.automation_jobs import AutomationJobStatus, ScheduleType
|
||||
from schemas.agent.skill_config import SkillName
|
||||
from schemas.domain.automation import (
|
||||
AgentTool,
|
||||
AutomationJobConfig,
|
||||
ContextSource,
|
||||
ContextWindowMode,
|
||||
@@ -23,7 +23,7 @@ from v1.automation_jobs.schemas import (
|
||||
def _make_config() -> AutomationJobConfig:
|
||||
return AutomationJobConfig(
|
||||
input_template="Hello",
|
||||
enabled_tools=[AgentTool.MEMORY_WRITE],
|
||||
enabled_skills=[SkillName.MEMORY],
|
||||
context=MessageContextConfig(
|
||||
source=ContextSource.LATEST_CHAT,
|
||||
window_mode=ContextWindowMode.DAY,
|
||||
@@ -119,7 +119,7 @@ async def test_update_merges_config_and_recomputes_next_run() -> None:
|
||||
existing_job.timezone = "UTC"
|
||||
existing_job.config = {
|
||||
"input_template": "Old",
|
||||
"enabled_tools": ["memory.write"],
|
||||
"enabled_skills": ["memory"],
|
||||
"context": {
|
||||
"source": "latest_chat",
|
||||
"window_mode": "day",
|
||||
@@ -136,7 +136,7 @@ async def test_update_merges_config_and_recomputes_next_run() -> None:
|
||||
|
||||
data = AutomationJobUpdateRequest(
|
||||
config=AutomationJobConfig(
|
||||
enabled_tools=[AgentTool.MEMORY_WRITE, AgentTool.MEMORY_FORGET],
|
||||
enabled_skills=[SkillName.MEMORY],
|
||||
schedule=ScheduleConfig(
|
||||
type=ScheduleType.WEEKLY,
|
||||
run_at=ScheduleRunAt(hour=10, minute=30),
|
||||
@@ -150,8 +150,8 @@ async def test_update_merges_config_and_recomputes_next_run() -> None:
|
||||
update_values = repository.update_by_id.call_args[0][1]
|
||||
assert "config" in update_values
|
||||
assert "next_run_at" in update_values
|
||||
enabled_tools = update_values["config"]["enabled_tools"]
|
||||
assert isinstance(enabled_tools[0], str)
|
||||
enabled_skills = update_values["config"]["enabled_skills"]
|
||||
assert isinstance(enabled_skills[0], str)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user