From f5689defa83ce1bf85b4ddd730b2fe2206796254 Mon Sep 17 00:00:00 2001 From: ymq Date: Thu, 27 Aug 2026 13:12:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(agent):=20=E4=BC=9A=E8=AF=9D=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E6=94=AF=E6=8C=81=20pipeline=5Fid=20=E4=BC=A0?= =?UTF-8?q?=E5=8F=82(=E9=BB=98=E8=AE=A4=E4=BA=A7=E7=BA=BF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/agent_chat.dspy | 4 +++- wwwroot/api/agent_menus.dspy | 16 +++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/wwwroot/api/agent_chat.dspy b/wwwroot/api/agent_chat.dspy index b0b0780..82d7686 100644 --- a/wwwroot/api/agent_chat.dspy +++ b/wwwroot/api/agent_chat.dspy @@ -76,6 +76,8 @@ if action == 'send_message': # ── 会话内唯一标识(web 多 tab 独立会话):前端每个 tab 传独立 session_id ── session_id = (params_kw or {}).get('session_id', '') or '' + # ── 产线默认能力(入口指定,如 bidding_general):无当前项目时装载该产线能力 ── + pipeline_id = (params_kw or {}).get('pipeline_id', '') or '' # ── 走 gateway 统一入口(Web AgentIO 通道)── from pipeline_service.gateway import get_gateway @@ -83,7 +85,7 @@ if action == 'send_message': async def agent_stream(): _base = entire_url("/") - async for chunk in gateway.run_message("web", uid, prompt, base_url=_base, session_id=session_id): + async for chunk in gateway.run_message("web", uid, prompt, base_url=_base, session_id=session_id, pipeline_id=pipeline_id): data = json.loads(chunk) t = data.get('type', '') diff --git a/wwwroot/api/agent_menus.dspy b/wwwroot/api/agent_menus.dspy index ed7e492..4c1cceb 100644 --- a/wwwroot/api/agent_menus.dspy +++ b/wwwroot/api/agent_menus.dspy @@ -10,6 +10,9 @@ if not uid: # 会话内唯一标识(web 多 tab;工作空间按钮按会话解析项目) session_id = (params_kw or {}).get('session_id', '') or '' +# 产线默认能力(入口指定,如 bidding_general):无当前项目时用该产线菜单/能力 +default_pipeline_id = (params_kw or {}).get('pipeline_id', '') or '' + # 1. 解析当前产线:当前会话项目 → sd_projects.pipeline_id pipeline_id = '' pid = '' @@ -40,11 +43,14 @@ except Exception: pass if not pipeline_id: - try: - from pipeline_core import DEFAULT_ABILITY_ID - pipeline_id = DEFAULT_ABILITY_ID - except Exception: - pipeline_id = 'sdlc_general' + if default_pipeline_id: + pipeline_id = default_pipeline_id + else: + try: + from pipeline_core import DEFAULT_ABILITY_ID + pipeline_id = DEFAULT_ABILITY_ID + except Exception: + pipeline_id = 'sdlc_general' # 2. 读产线功能菜单 try: