根因: 1. tool_registry 全局单例跨会话污染:产线会话注册的工具(如 list_projects) 永久残留,后续通用会话把全部工具塞给 LLM 2. generic 会话 pipeline_id 空被无条件回退 DEFAULT_ABILITY_ID(sdlc_general), _execute_ability_tool 拿到产线能力包直接执行 3. _h_list_projects 对 space='general' 不过滤,列出所有产线全部项目 4. GENERAL_TOOLS 本身含项目管理工具,通用会话无条件拿到 修复(纵深防御,schema 层+执行层双保险): - agent_loop_v2: ToolRegistry 改每 executor 独立实例(禁全局单例) - agent_loop_v2: generic 会话跳过默认产线回退 - agent_loop_v2: _execute_ability_tool 对 generic 直接返回 None - agent_loop_v2: _dispatch_sdlc_tool 对 generic 拒绝项目类工具(含别名归一) - agent_loop_v2: generic 记忆只读 global 域、技能只检索 global 层 - sdlc_ability: _h_list_projects 对 general 空间拒绝列项目 配套:pipeline-core load_agent_config generic 时剔除 category=project 工具
pipeline_service
产线执行引擎 —— 任务调度、步骤执行、人工任务交互、LLM 桥接。
功能
- 任务执行:DAG 步骤调度与状态机
- 人工任务:审批/输入等待与交互
- LLM 桥接:统一 LLM 调用接口
- Agent Loop:AI Agent 多轮任务执行
- 意图分类:自然语言意图识别
- 产物管理:步骤输入输出存储
数据表
| 表 | 说明 |
|---|---|
| pipeline_tasks | 任务实例 |
| pipeline_task_steps | 步骤执行记录 |
| pipeline_artifacts | 步骤产物 |
| pipeline_human_tasks | 人工任务 |
| pipeline_step_types | 步骤类型注册 |
安装
cd pkgs/pipeline-service && pip install .
核心模块
| 文件 | 职责 |
|---|---|
executor.py |
任务/步骤调度引擎 |
storage.py |
数据库读写 |
llm_bridge.py |
LLM API 调用 |
agent_loop.py |
AI Agent 多轮执行 |
human.py |
人工任务处理 |
intent_classifier.py |
意图识别 |
state.py |
状态机 |
step_registry.py |
步骤类型注册表 |
Description
Languages
Python
99.5%
Shell
0.5%