refactor: unify skills+cli runtime and streamline ag-ui flow

This commit is contained in:
qzl
2026-04-22 17:09:37 +08:00
parent eeed737949
commit 4d55df45ab
111 changed files with 4858 additions and 3264 deletions
@@ -5,27 +5,20 @@ import pytest
from schemas.agent.system_agent import SystemAgentLLMConfig
def test_system_agent_llm_config_normalizes_enabled_tools_aliases() -> None:
def test_system_agent_llm_config_normalizes_enabled_skills() -> None:
config = SystemAgentLLMConfig.model_validate(
{
"enabled_tools": [
"calendar.write",
"calendar_write",
"user.lookup",
]
"enabled_skills": ["calendar", "calendar", "contacts"]
}
)
assert [tool.value for tool in config.enabled_tools] == [
"calendar.write",
"user.lookup",
]
assert [skill.value for skill in config.enabled_skills] == ["calendar", "contacts"]
def test_system_agent_llm_config_rejects_unknown_enabled_tool() -> None:
with pytest.raises(ValueError, match="unknown enabled tool"):
def test_system_agent_llm_config_rejects_unknown_enabled_skill() -> None:
with pytest.raises(ValueError):
SystemAgentLLMConfig.model_validate(
{
"enabled_tools": ["calendar.remove"],
"enabled_skills": ["calendar.remove"],
}
)