feat(agent): 会话入口支持 pipeline_id 传参(默认产线)

This commit is contained in:
ymq 2026-08-27 13:12:45 +08:00
parent 7ffb5bd773
commit f5689defa8
2 changed files with 14 additions and 6 deletions

View File

@ -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', '')

View File

@ -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: