diff --git a/wwwroot/api/cockpit_chat.dspy b/wwwroot/api/cockpit_chat.dspy index e849e81..acbc125 100644 --- a/wwwroot/api/cockpit_chat.dspy +++ b/wwwroot/api/cockpit_chat.dspy @@ -658,18 +658,18 @@ if action == 'send_message': await _save_context(sor, uid, proj.id, '') else: pid = getID() - # 创建工作目录:检测 /d 可写性,不可写时回退 /tmp/pipeline_ws - ws_base = '/d/pipeline/workspaces' + # 创建工作目录:优先 ~/pipeline_ws,不可写时回退 + ws_base = os.path.expanduser('~/pipeline_ws') try: - if not os.path.isdir(os.path.dirname(ws_base)) or not os.access(os.path.dirname(ws_base), os.W_OK): - ws_base = '/tmp/pipeline_ws' + os.makedirs(ws_base, exist_ok=True) except Exception: ws_base = '/tmp/pipeline_ws' + os.makedirs(ws_base, exist_ok=True) ws_dir = f"{ws_base}/{org_id}/{pname}" try: os.makedirs(ws_dir, exist_ok=True) except Exception: - ws_dir = f"/tmp/pipeline_ws/{pname}" + ws_dir = os.path.expanduser(f'~/pipeline_ws/{pname}') os.makedirs(ws_dir, exist_ok=True) await sor.C('sd_projects', { 'id': pid, 'name': pname, 'description': intent.get('description', ''),