1. memory 工具(add/list/remove): 多租户写入门禁——org_id/user_id强制注入、 scope白名单user/project/pipeline(global/org种子域禁写)、无身份拒写、 remove仅本人条目; 记忆注入改可见性过滤版(修跨机构泄漏) 2. manage_skill(create/patch/write_file/remove_file/delete): skill_live扩展, 只落本租户orgs/users目录, global原版fork-on-write(校验通过才fork,失败零残留), org+user双副本同步改, 产线层拒改, delete只删本租户副本+审计留痕 3. run_command background=true + process工具(poll/log/wait/kill): bg_jobs.py 状态文件化(workspace/.bg/,跨worker可见), 沙箱档位与前台一致(generic强制 strict+无bwrap拒绝), 超时SIGTERM进程组+stale心跳判活 4. delegate_subtask background + subagent工具(list/steer/stop/result): subagents.py 并行上限3/workspace, 深度限制1(子agent禁再委派), 子会话session_isolation=none(不读父历史不写会话表), steer/stop文件传递 每轮tool-loop边界消费, 结果流式落盘(stop即部分结果)
pipeline_service
产线执行引擎 —— 任务调度、步骤执行、人工任务交互、LLM 桥接。
功能
- 任务执行:DAG 步骤调度与状态机
- 人工任务:审批/输入等待与交互
- LLM 桥接:统一 LLM 调用接口
- Agent Loop:AI Agent 多轮任务执行
- 意图分类:自然语言意图识别
- 产物管理:步骤输入输出存储
数据表
| 表 | 说明 |
|---|---|
| pipeline_tasks | 任务实例 |
| pipeline_task_steps | 步骤执行记录 |
| pipeline_artifacts | 步骤产物 |
| pipeline_human_tasks | 人工任务 |
| pipeline_step_types | 步骤类型注册 |
| pipeline_session_settings | 会话设置(多 tab 项目上下文) |
| pipeline_conversations | 平台会话消息(回放缓存;2026-09-10 归籍本模块——唯一写入方 agent_loop_v2._save_turn,此前是无 models 定义的孤儿表) |
安装
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 |
步骤类型注册表 |
agent_loop_v2.py |
Agent Executor v2(会话 agent 执行引擎) |
workspace.py |
项目/通用会话工作空间目录管理 |
sdlc_ability.py |
SDLC 产线能力包(工具定义 + handler) |
通用会话产线隔离(2026-09-05,7 层纵深防御)
规范:通用会话(generic=True,agent_chat_generic.dspy)= 纯通用 agent, 不挂任何产线工具/技能/角色/记忆,不得看到或操作任何产线的项目。
隔离层(缺一层即泄漏,详见技能 cockpit-agent-patterns):
- 工具注册表:ToolRegistry 每 executor 独立实例(禁全局单例,防跨会话残留)
- 默认产线回退:generic 会话 pipeline_id 空不回退 DEFAULT_ABILITY_ID
- 产线能力包:_execute_ability_tool 对 generic 直接拒绝
- 工具 schema:load_agent_config(pipeline-core)generic 时剔除 project/shell 类工具
- 执行层兜底:_dispatch_sdlc_tool 对 generic 拒绝项目管理工具(别名归一后拦截)
- 工作空间:generic 会话文件根 =
_general/{user_id}专属目录(generic_workspace_dir), _resolve_ws_path 越界保护圈死;run_command 剔除(shell 无法圈禁); resolve_upload_dir(pipeline-core)generic=True 上传落同一专属目录 - 历史回放:_load_history / _t_session_search 对 generic 只读写
pipeline_id='' OR IS NULL的自身历史(与存库端 store_pl='' 对称), 禁止按 created_by 全量回放(会带出用户各产线对话中的项目信息)
Description
Languages
Python
99.5%
Shell
0.5%