diff --git a/pipeline_service/agent_loop.py b/pipeline_service/agent_loop.py index 402c3ba..0467ed9 100644 --- a/pipeline_service/agent_loop.py +++ b/pipeline_service/agent_loop.py @@ -1782,6 +1782,18 @@ async def pm_review_run(project_id, agent_id=None, model_name=None): if _it_status in ('completed', 'cancelled'): logger.info(f"迭代边界:任务 {task_id} 归属迭代「{task_iter}」已 {_it_status},链终止") return {"status": "completed", "task_id": task_id, "comment": comment or "迭代已结束,链终止"} + # 部署以应用为单位:模块级 develop(PM 按模块派发,params 含 pm_assigned)approved 后 + # 不创建 deploy_test——模块不独立部署,deploy_test 是应用级,由应用脚手架 develop 触发。 + # 否则每个模块都会生成一个 deploy_test,导致「部署以模块为单位」(多端口问题的部署侧根源)。 + _tp = {} + try: + _tp = json.loads(getattr(task, 'params', '{}') or '{}') + except Exception: + _tp = {} + if task_role == 'agent.develop' and _tp.get('pm_assigned'): + logger.info(f"模块级 develop approved,跳过 deploy_test(部署以应用为单位): {task_id}") + return {"status": "approved", "task_id": task_id, "comment": comment, + "next_role": "", "skip_next": "module_not_deployed_independently"} next_tid, next_title = await _create_next_task(sor, project_id, task, next_role, comment) return {"status": "approved", "task_id": task_id, "next_task_id": next_tid, "next_role": next_role, "comment": comment} else: