fix: list_projects严格产线隔离——删除all=true出口(模型会主动跨产线)

This commit is contained in:
ymq 2026-08-29 09:02:37 +08:00
parent c510ef14a9
commit 05e740d662

View File

@ -177,7 +177,7 @@ SDL_TOOLS = [
category="feature",
),
# ── 项目生命周期 ──
ToolDefinition(name="list_projects", description="列出项目列表(含状态)——按当前产线隔离,产线会话只见本产线项目;传 all=true 跨产线看全部", parameters={"status": "按状态筛选(可选)", "all": "true=跨产线列全部项目(默认只列本产线)"}, category="project"),
ToolDefinition(name="list_projects", description="列出项目列表(含状态)——严格产线隔离,只列当前产线的项目", parameters={"status": "按状态筛选(可选)"}, category="project"),
ToolDefinition(name="list_role_models", description="列出项目各角色的模型配置(缺省用项目缺省模型)", parameters={"project_id": "项目ID"}, category="project"),
ToolDefinition(name="set_role_model", description="设置某角色的模型(如 deploy_test 用 qwen3.8-maxmodel_name 空=清除回退缺省)", parameters={"project_id": "项目ID", "role": "角色名(agent.develop/agent.deploy_test等)", "model_name": "模型名(llm.name空=回退缺省)"}, category="project"),
ToolDefinition(name="start_project", description="启动项目(draft/archived→active)", parameters={"project_id": "项目ID"}, category="project"),
@ -1091,14 +1091,12 @@ async def _h_list_projects(sor, p, ctx):
if _u:
org_id = getattr(_u[0], "orgid", "") or ""
status = (p.get("status", "") or "").strip()
# 产线隔离真实产线会话space≠general只列本产线项目——
# 产线隔离(强制)真实产线会话space≠general只列本产线项目——
# 投标/商机产线不串出开发产线的项目。通用助手会话不过滤。
# 用户明确要跨产线看全部时传 all=true。
pipeline_filter = None
if (p.get("all", "") or "").strip().lower() not in ("true", "1", "yes"):
space = ctx.get("space", "") or ""
if space and space != "general":
pipeline_filter = space
space = ctx.get("space", "") or ""
if space and space != "general":
pipeline_filter = space
lst = await list_projects(org_id=org_id or None, status=status or None,
pipeline_id=pipeline_filter)
if not lst: