ymq
191d28547b
fix: paused 生命周期三处修复——切迭代自动 resume + 三 poller 统一排除 paused
...
1. start_next_iteration 启动新迭代后自动 resume_project:旧迭代遗留的 paused
(任务达上限触发 failed_poller 自动 pause)随任务作废消除,新迭代恢复 active,
否则 PM poller 跳过 review 任务导致新迭代卡在 PM 审核(2026-08 实测卡 27 分钟)
2. agent poller / qc poller 也排除 paused 项目,与 PM poller 语义统一:
paused = 完全暂停推进(不派发/不审查/不审核),消除「任务照常派发却卡审核」半吊子状态
2026-08-22 17:39:13 +08:00
ymq
f17f745ac6
fix(sdlc): pm_poller 队列饥饿——paused 项目僵尸 review 任务卡队头饿死 active 项目
...
根因:pm_poller SELECT state='review' AND claimed_by IS NULL ORDER BY created_at ASC LIMIT 5,
只取最老 5 个 review 任务,但暂停门控在 pm_review_run 认领后才检查。paused 项目(人事系统/人事系统1)
的 8 个 develop/deploy_test 僵尸任务永远占住队头,每 15s dispatch 后暂停门控 return idle、claimed_by 恒 NULL,
active 项目(人事项目2)的 requirement/design 任务排在后面对、永远进不了 LIMIT 5 窗口 → PM 无法推进项目。
修复(对齐 agent_poller 队列饥饿修复三件套):
1. SELECT 加 NOT EXISTS paused 项目过滤(暂停门控提前到筛选阶段)
2. LIMIT 5 → 200 容纳僵尸任务
3. 项目轮询 round-robin 保证项目间公平
2026-08-21 13:20:32 +08:00
ymq
ff2179be67
feat(poller): 每项目/租户并发上限 max_agents_per_project,防单项目占满全局并发
...
agent_poller 项目轮询基础上,新增每项目并发门控:
- 读 appbase params 表 max_agents_per_project(默认 4),改后下一轮(10s)立即生效
- 每轮查各项目 running 计数(GROUP BY tenant_id),达上限的项目跳过不派新任务
- 改小后不强制杀,超出的 running 任务自然跑完即「等其完成」语义
- 与全局 max_concurrent_agents(默认3→预置10) + 项目轮询配套,形成三级并发控制
2026-08-20 15:44:51 +08:00
ymq
77f5aa45dc
fix(poller): 依赖门控提前到候选筛选 + 项目轮询,修复队列饥饿
...
agent_poller 原来 SELECT 后 [:avail] 截断只取队列头 avail 个任务,依赖门控却
在认领阶段(_claim_task)才检查——依赖未满足的僵尸 submitted 任务(created_at 最早)
永久占住队头,导致其他项目/新任务饿死(一项目卡死全平台瘫痪)。
改动:
1. 候选 SELECT 带上 depends_on,批量查依赖状态,排除依赖未满足的任务(终态=completed/approved)
2. 项目轮询(round-robin): 按 tenant_id 分组轮流取就绪任务,保证项目间公平
3. SELECT LIMIT 20->200 容纳僵尸任务;批量查依赖替代 N+1
2026-08-20 11:34:49 +08:00
ymq
1eba1c3f87
feat(worker): load_pipeline_service 按 PIPELINE_MODE 门控 poller 注册(web=仅HTTP无poller, worker=仅poller, all=默认)
2026-08-18 17:15:21 +08:00
ymq
31ba001482
refactor(init): 移除 _init_v2_tables 启动期建表/加列,schema 变更统一走部署期 create_tables.py
2026-08-18 16:02:19 +08:00
ymq
ab776d0c37
feat: 新增 QC 角色(质量门禁)+ 部署拆分为 deploy_test/deploy_prod + requirement 明确部署环境需求
...
- SDL_ROLES 6 环新链:requirement→design→develop→deploy_test→test→deploy_prod,新增 agent.qc
- 状态机新增 qc_review:角色交付→QC 合规/质量检查→PM 验收→下一环
- qc_review_run + qc poller;不合规退回重做
- requirement 职责增加部署环境需求明确
2026-08-18 15:16:43 +08:00
ymq
b819a665f6
fix: poller 加 watchdog(wait_for 60s 超时),防连接池/MDL 锁卡死导致停摆
...
agent_poller 和 pm_poller 的 poll_loop 改为 _poll_once + asyncio.wait_for(timeout=60)
包裹,每轮 poll 卡住超过 60s 就跳过本轮继续,不再因连接池耗尽/MDL 锁等待
(lock_wait_timeout 默认 24h)而永久停摆(2026-08 生产事故:poller 停摆 15.7h)。
2026-08-18 11:14:23 +08:00
ymq
0b75f10731
Revert "fix: 心跳超时从 20 分钟回收重跑改为 10 分钟强制结束标注超时失败"
...
This reverts commit feb88aca023fdf0859fa1f8dae589acbd14c771c.
2026-08-18 10:59:51 +08:00
ymq
feb88aca02
fix: 心跳超时从 20 分钟回收重跑改为 10 分钟强制结束标注超时失败
...
running 任务 updated_at 超 10 分钟未更新(进程崩溃/协程挂起僵尸),原逻辑回收回
submitted 重跑,改为 state=failed + last_error=心跳超时。中文 last_error 让
_classify_failure 判 fault 不自动重跑,failed_poller 报故障通知用户。
2026-08-18 10:53:13 +08:00
ymq
3687270ca7
feat(task-capability): 任务状态机语义化迁移能力 + 通用审计原语
...
- task_capability.py: claim/submit/approve/reject/complete/mark_failed/retry/suspend/revive/set_task_state
CAS 原子迁移(防并发/越权覆盖) + tenant 隔离 + record_audit 审计
定位=状态机语义化操作层,CRUD 复用 storage.py,不遮蔽 storage/executor 同名函数
- audit.py: record_audit append-only 通用审计原语(支持 sor 复用避免嵌套连接)
- models/audit_log.json: 审计日志表(append-only, tenant 隔离)
- init.py: 注册 task_* + record_audit 到 ServerEnv
2026-08-16 23:39:05 +08:00
ymq
6707cabedc
refactor(team-communication): 问题冒泡改为显式路由,规范移交 skill
...
规范(团队角色/问题类型/冒泡路径)移交 team-communication skill,由 LLM 读 skill 决策;
系统只固化通用问题工具,不读配置表、不存路径快照:
- communication.py: raise/resolve/escalate/list_for 显式路由,
escalate 显式传 next_handler;current_handler_role/agentid 两列确定性过滤
- questions.py: 向后兼容层适配
- agent_loop.py: need_info/review_reject/fault_report 显式 first_handler_role
- sdlc_ability.py: escalate_question 显式转 customer
- models: 去 escalation_path/pos,加 current_handler_role/agentid
2026-08-16 22:08:00 +08:00
ymq
4f2c6da6cf
feat(team-communication): 通用问题冒泡引擎(多agent感知)
...
- communication.py: raise/resolve/escalate/list_for,问题类型→冒泡路径,处理方=role+agentid
- questions.py: 向后兼容层,委托 communication
- agent_loop.py: 角色提问(need_info)/PM退回(review_reject)/故障(fault_report)走 raise_problem;
_build_qna_section 按 handler 路由注入;PM approved 只答结 review_reject
- sdlc_ability.py: list_questions/answer_question/escalate_question 按 handler 路由
- models: pipeline_agent_questions 加 from_agentid/problem_type/escalation_path/escalation_pos
2026-08-16 21:25:39 +08:00
ymq
2cdd3cb986
feat: gateway服务层(统一消息入口+会话生命周期+通道注册)+AgentIO适配走gateway
2026-08-15 10:02:54 +08:00
ymq
82b0944424
feat: 全局并发agent数限制(max_concurrent_agents params表)+机构工作目录workspace_base动态化(_is_safe_workdir读params表)
2026-08-15 10:00:03 +08:00
ymq
14a42aac7b
fix: SELECT-only 事务显式 COMMIT,修复 MDL 元数据锁泄漏阻塞 DDL
...
failed poller / handle_failed_task 的 SELECT-only 事务未提交,连接回池后仍持有元数据锁,
导致 ALTER TABLE ADD COLUMN 卡死并阻塞整表。改为 SELECT 后显式 COMMIT 释放锁。
2026-08-15 01:09:05 +08:00
ymq
aa0dcc9c04
feat: 失败任务处理第二层——failed poller 自动重跑(最多3次)+报故障给用户
...
- pipeline_tasks 加 retry_count/last_error 列(启动时幂等 DDL)
- role/pm agent 失败时记录 last_error(含异常类型)
- handle_failed_task: 瞬时错误(超时/连接/5xx/429)重跑,永久错误或重试>=3次报故障(建问题通知用户,任务置 waiting)
- init.py: 新增 failed poller 每60s扫描 failed 任务,role任务由pm上报、pm任务由cockpit上报
2026-08-15 00:57:05 +08:00
ymq
8c0d63efb1
fix: LLM 调用加瞬时错误重试(3次) + 超时 180s→300s(connect 30s);心跳回收阈值 10→20 分钟防误杀慢任务
...
- llm_bridge: 抽出 _post_chat_completion,超时/连接错误/429/5xx 重试3次退避;total=300 connect=30
- init.py: 僵尸回收阈值对齐 LLM 最坏单轮时长(3×300s≈15min),20分钟
- agent_loop_v2: diagnose 心跳超时判定 10→20 分钟
2026-08-15 00:46:30 +08:00
ymq
bc5ce2f06d
fix: 任务链卡死根治 — 心跳+stale回收+claimed_by僵尸锁清除
...
- questions.py: agent_ask/answer_question 置 waiting/submitted 时清 claimed_by,否则 poll 器永不重新认领
- agent_loop_v2.py: _t_answer_question 回答后恢复任务 waiting→submitted(此前只标记问题已答,任务永久卡 waiting)
- agent_loop.py: _claim_task 加 claimed_by IS NULL 原子认领 + updated_at 心跳;role/pm 循环心跳 COMMIT;pm 认领保持 review 态
- init.py: role poller 回收僵尸 running 任务、pm poller 回收僵尸 review 任务(心跳超时 10 分钟)
2026-08-15 00:11:36 +08:00
ymq
d2f3caf8a7
refactor: workspace 路径解析收敛到 workspace.py,dspy 消除重复
...
- workspace.py 加 get_workspace_dir/get_workspace_base + load_workspace 注册到 ServerEnv
- 8 个 workspace dspy 内联重复的'读 workspace_base + 查 project 算 ws_dir'改为调 get_workspace_dir
- _t_create_project 复用 get_workspace_base(删掉死代码 _get_param)
- workspace.py 从 untracked 变为已跟踪提交
2026-08-14 18:07:33 +08:00
ymq
92ee88d1f4
refactor: 审计逻辑迁移到独立模块 app_audit
...
- 移除 pipeline_service/audit_service.py(迁移到 app_audit)
- __init__.py 移除 audit import,init.py 移除 sd_audit_logs/owner.audit DDL
2026-08-14 12:20:36 +08:00
ymq
eaaf5fad26
feat: 审计日志全局模块(append-only,查看/备份/删除仅 owner.audit)
...
- audit_service.py: audit_log 写入 + is_audit_role + list/backup/delete
- sd_audit_logs 表 + owner.audit 角色 DDL
- 审计独立性:owner.superuser 也无权查看审计日志
2026-08-14 12:10:57 +08:00
ymq
262d678e2a
feat: 工作环境管理(沙箱本地/远程切换 + 目录迁移)
...
- work_env.py: get/set_work_env(用户/机构维度,缺省local)、rsync目录迁移、远程SSH+bwrap沙箱、远程bwrap部署
- run_in_work_env: 按mode分发本地bwrap/远程SSH+bwrap
- sd_work_envs 表 DDL
2026-08-14 11:12:54 +08:00
ymq
08ae248c2a
feat: 应用部署主机逻辑账号系统(零root+bwrap沙箱)
...
- deploy_account.py: 逻辑账号(ag_前缀)创建/删除/列表,bwrap沙箱执行,免密目录读写
- 零root:不建真实Linux账号,逻辑隔离目录 + unprivileged user namespace
- init.py: sd_deploy_accounts 表 DDL 自动初始化
2026-08-13 17:57:09 +08:00
ymq
ea9b0f2ae4
feat: auto-add agent_config columns to DB
2026-08-10 17:01:18 +08:00
ymq
cd9208cbf4
feat: auto-create pipeline_user_memory table on startup
2026-08-10 11:10:53 +08:00
ymq
2d6709ee33
feat: Agent v2 执行引擎 - AgentExecutor with compression/memory/skills
2026-08-10 11:06:42 +08:00
ymq
eb889d8694
fix: poller dedup dispatched tasks + error handling to prevent lock pile-up
2026-08-08 13:43:19 +08:00
ymq
74ce3339d2
v3.4.0: agents produce real code files + git push + PM clones repos
...
- All agents can write code files via 'files' array in output JSON
- Auto git commit+push after code file creation
- PM agent clones project repos on first review
- PM review shows repository state
- shell_exec now allows ~/pipeline_ws
- Role-specific prompts guide code/file output
2026-08-08 11:42:49 +08:00
ymq
0270922205
v3.3.0: PM agent + task chain + workspace + file output
2026-08-08 10:36:04 +08:00
48f5048df8
fix: shell_exec 目录不存在时回落可写基础目录
2026-08-05 18:01:17 +08:00
1f848e0760
fix: _resolve_workdir 先检查父目录存在+可写再 mkdir
2026-08-05 17:58:53 +08:00
222bdbcd3d
fix: _resolve_workdir → /tmp 回落(apitest无/d写权限)
2026-08-05 17:58:00 +08:00
5a7104aa5d
feat(v3.2.1): shell_exec + skill_import_git — 主agent devops能力
...
- shell_exec: 安全子进程执行(沙箱在 /d/pipeline/workspaces 下,60s超时)
- skill_import_git: git clone + skills目录扫描,返回技能列表
- 注册到 env,cockpit_chat 可通过 dspy 直接调用
2026-08-05 17:56:22 +08:00
ee9ab066fc
fix: on_startup handler spawn 后台任务后立即返回(不阻塞 aiohttp 启动)
2026-08-05 17:31:27 +08:00
99cc19f9aa
fix: _role_poller 接受 app 参数(aiohttp on_startup 信号)
2026-08-05 17:28:23 +08:00
0bd9609532
fix: add_startup 传函数引用(非协程对象)
2026-08-05 17:27:24 +08:00
4c0b349718
feat: 后台轮询器 — add_startup 自动执行 role_task
...
- _role_poller 每10秒扫描 pipeline_tasks 中 submitted 的 role_task
- 逐条 dispatch 给对应角色 agent_loop 异步执行
- 修复 agent_loop 中 agent_ask 导入为相对导入
2026-08-05 17:20:26 +08:00
4cb406003e
feat(v3.2.0): 主agent+角色agent架构 — role任务认领/问题回路
...
- pipeline_tasks 增加 role/claimed_by 字段+索引(存量库需ALTER)
- agent_loop 重写为角色循环:原子认领(role匹配+令牌校验)→LLM执行→交付/need_info提问
- 角色别名归一化(developer→develop等),ROLE_PROMPT改replace防花括号崩溃
- questions.py 新增问题回路:agent_ask/answer_question/forward_question/list_questions
- init.py 注册 pipeline_role_submit 与问题回路 env 接口
2026-08-05 12:58:52 +08:00
59e56b5e9c
feat: Phase 2+4 — agent_loop engine + project agent config
2026-08-02 14:59:32 +08:00
0423fa3c99
refactor: add intent_classifier.py, register in init.py, LLM bridge shared
2026-08-02 00:00:20 +08:00
23047eed95
feat: add pipeline_restart() - restart completed/failed/cancelled tasks with new version
2026-07-08 21:03:20 +08:00
Hermes Agent
a44130b23b
refactor(v3.1): decouple KTV handlers — pipeline-service is pure engine
...
- Remove handlers_ktv.py (943 lines) — KTV is now an external adapter
- Remove register_ktv_handlers() from load_pipeline_service()
- Remove KTV imports from __init__.py
- pipeline-service no longer knows about any specific pipeline type
- Version bump: 3.0.0 → 3.1.0
Each pipeline type should be a separate adapter package that calls:
register_handler(step_type, fn)
register_step_type(step_type, metadata)
This keeps pipeline-service stable and lets adapters evolve independently.
2026-06-16 11:11:05 +08:00
Hermes Agent
b9a5810d85
feat(v3): human-in-the-loop — interactive steps, pluggable step_type registry
...
- New states: waiting (step/task), rejected (step)
- New tables: pipeline_human_tasks, pipeline_step_types
- New module: step_registry.py — pluggable step_type metadata
- New module: human.py — human_complete, approval_approve, approval_reject
- Executor: detects interactive step_types, creates human_tasks, enters waiting
- Reject with rollback: approval_reject(rollback_to=step) resets steps and re-runs
- API: human_task_complete, approval_approve, approval_reject, human_task_list
- API: pipeline_step_types, pipeline_register_step_type, pipeline_unregister_step_type
- Built-in interactive types: human_task, approval_gate
- Updated DDL and appcodes
2026-06-16 11:05:45 +08:00
113eb7e040
feat: add KTV pipeline handlers (17 step types, 3 production modes)
...
- handlers_ktv.py: 17 async step handlers for KTV production
- Audio/Video preparation (ffmpeg)
- Demucs vocal separation (GPU server SSH)
- Lyric calibration (SenseVoice ASR + LLM)
- Subtitle rendering (ASS karaoke format)
- Lyric generation & evaluation (Mode C)
- Music generation (Suno/MiniMax API)
- Character design & image generation (wan2.7)
- Storyboard generation (LLM)
- Scene video generation (T2V/Ref2V)
- Scene video evaluation (quality threshold)
- Scene video concatenation (ffmpeg loop)
- KTV synthesis (dual-track + MTV)
- llm_bridge.py: async LLM call bridge (harnessed_agent / OpenAI API)
- storage.py: extract deps from step_config JSON
- init.py: auto-register KTV handlers on load
2026-06-11 20:36:05 +08:00
2448ad45f7
refactor: 改造为通用产线执行引擎模块
...
- 去掉独立 aiohttp 服务器,改为标准模块(load_pipeline_service)
- 存储从文件系统改 MySQL(sqlor)
- 新增 3 张数据表:pipeline_tasks/task_steps/artifacts
- 多租户隔离(tenant_id)
- 通用 DAG 调度引擎(读 pipeline_steps 表,不硬编码业务)
- 可插拔步骤处理器(register_handler by step_type)
- artifact 版本管理 + 级联重跑
- init/data.json 标准 appcodes 格式
- 完整 README 文档
2026-06-11 17:30:06 +08:00