feat: 新增工具插件、系统日志、workflow配置及前端优化

1. 新增工具插件(edit_file, python_executor, search_file, shell_executor, write_file)
2. 新增系统事件日志模块和API
3. 新增workflow配置文件和详情API
4. 前端增加SSE、错误边界、设置引导等组件
5. 优化认证加密、速率限制、配置加载等工具模块
6. 删除废弃的cluster和health API
7. 补充单元测试和集成测试

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 07:34:43 +00:00
parent f04fef916f
commit a53ffebe0e
57 changed files with 2804 additions and 271 deletions
+34
View File
@@ -288,3 +288,37 @@ def test_workflow_graph_state_defaults():
assert state.final_status == WorkflowStatus.RUNNING.value
assert state.logs == []
assert state.original_command == ""
assert state.jump_counts == {}
@pytest.mark.asyncio
async def test_loop_retry_exceeds_max_attempts_fails(monkeypatch):
"""环跳转超过 max_attempts 后,工作流应直接 FAILED 而非无限重试。"""
from kilostar.utils import config_loader
from kilostar.utils.config_loader import WorkflowConfig, RetryConfig
monkeypatch.setattr(config_loader, "_current", WorkflowConfig(retry=RetryConfig(max_attempts=2)))
deps, sink = _make_deps(
skill_outputs=[
("o1", True),
("fail", False),
("o1", True),
("fail", False),
("o1", True),
("fail", False),
("o1", True),
("fail", False),
]
)
workflow_data = {
"work_link": [
{"step": 1, "name": "s1", "action": "do",
"node": "skill_individual", "agent_id": "a1"},
{"step": 2, "name": "s2", "action": "do",
"node": "skill_individual", "agent_id": "a2",
"logic_gate": {"if_fail": "jump_to_step_1", "if_pass": "continue"}},
]
}
final = await run_workflow_graph(workflow_data, "trace-loop-limit", deps=deps)
assert final == WorkflowStatus.FAILED.value