diff --git a/pipeline_service/agent_loop.py b/pipeline_service/agent_loop.py index 2bff03f..af74b58 100644 --- a/pipeline_service/agent_loop.py +++ b/pipeline_service/agent_loop.py @@ -947,7 +947,27 @@ async def _create_next_task(sor, project_id, task, next_role, pm_comment=''): params = json.loads(params_str) if isinstance(params_str, str) else params_str except (json.JSONDecodeError, TypeError): params = {} - new_title = f"{title}({next_role}阶段)" + # 标题:不再继承上一任务 title + 追加「({next_role}阶段)」——那是 title 继承 bug 的根源, + # 导致 design 任务名变成「需求规格说明书(agent.design阶段)」跟需求名混同,回退重做后更叠加成 + # 「...(回退重做)(agent.develop阶段)(agent.deploy_test阶段)」。改为按 next_role 的声明式 + # task_title 生成语义标题(项目名 + 阶段语义),阶段标题模板由 RoleSpec.task_title 声明。 + stage = next_role + try: + pid = await _resolve_pipeline_id(project_id) + from pipeline_core import get_role_spec + spec = get_role_spec(pid, next_role) + if spec and getattr(spec, 'task_title', ''): + stage = spec.task_title + except Exception: + pass + pname = '' + try: + _p = await sor.sqlExe("SELECT name FROM sd_projects WHERE id=${pid}$", {"pid": project_id}) + await sor.sqlExe("COMMIT", {}) + pname = getattr(_p[0], 'name', '') if _p else '' + except Exception: + pname = '' + new_title = f"{pname} {stage}" if pname else stage new_params = {**params, 'previous_role': _normalize_role(getattr(task, 'role', '')), 'previous_task_id': getattr(task, 'id', ''), 'pm_comment': pm_comment} # 任务来源标记:系统自动派生(design→develop→deploy_test→test)都是「新开发」链, diff --git a/pipeline_service/sdlc_ability.py b/pipeline_service/sdlc_ability.py index 2c8d939..581cc24 100644 --- a/pipeline_service/sdlc_ability.py +++ b/pipeline_service/sdlc_ability.py @@ -271,6 +271,7 @@ SDL_ROLES = [ aliases=["requirements", "requirement_analysis"], system_prompt="""你是需求分析师。先 load_skill 加载 role 技能,按其中的职责与应遵守规范执行任务。""", next_role="agent.design", + task_title="应用架构与模块设计", ), RoleSpec( name="agent.design", @@ -278,6 +279,7 @@ SDL_ROLES = [ aliases=["designer", "ui", "ux"], system_prompt="""你是系统设计师。先 load_skill 加载 role 技能,按其中的职责与应遵守规范执行任务。""", next_role="agent.develop", + task_title="应用脚手架开发", ), RoleSpec( name="agent.develop", @@ -285,6 +287,7 @@ SDL_ROLES = [ aliases=["developer", "dev", "development", "coding"], system_prompt="""你是开发工程师。先 load_skill 加载 role 技能,按其中的职责与应遵守规范执行任务。""", next_role="agent.deploy_test", + task_title="部署测试", ), RoleSpec( name="agent.deploy_test", @@ -292,6 +295,7 @@ SDL_ROLES = [ aliases=["deploy_staging", "staging"], system_prompt="""你是测试环境部署工程师。先 load_skill 加载 role 技能,按其中的职责与应遵守规范执行任务。""", next_role="agent.test", + task_title="功能测试", ), RoleSpec( name="agent.test",