From 5c22f29bf9f2072266eb9629e5e72c1845b4ee73 Mon Sep 17 00:00:00 2001 From: xiamuceer Date: Fri, 24 Apr 2026 16:50:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=92=E8=89=B2/?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=A1=E9=AA=8C=E7=94=9F=E6=88=90=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/wizard_stream.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/app/api/wizard_stream.py b/backend/app/api/wizard_stream.py index c1e305a..8061eb8 100644 --- a/backend/app/api/wizard_stream.py +++ b/backend/app/api/wizard_stream.py @@ -1280,6 +1280,11 @@ async def outline_generator( if not project: yield await tracker.error("项目不存在或无权访问", 404) return + + # 设置用户信息以启用MCP,并确保后续自动角色/组织补全使用当前请求的AI服务上下文 + if user_id: + user_ai_service.user_id = user_id + user_ai_service.db_session = db # 获取角色信息 yield await tracker.loading("加载角色信息...", 0.8)