fix: use /tmp/pipeline_ws as workspace fallback (pipeline-owned)

This commit is contained in:
ymq 2026-08-08 11:13:07 +08:00
parent b5892601ca
commit d0a801f283

View File

@ -658,18 +658,18 @@ if action == 'send_message':
await _save_context(sor, uid, proj.id, '')
else:
pid = getID()
# 创建工作目录:检测 /d 可写性,不可写时回退 /tmp
# 创建工作目录:检测 /d 可写性,不可写时回退 /tmp/pipeline_ws
ws_base = '/d/pipeline/workspaces'
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_workspaces'
ws_base = '/tmp/pipeline_ws'
except Exception:
ws_base = '/tmp/pipeline_workspaces'
ws_base = '/tmp/pipeline_ws'
ws_dir = f"{ws_base}/{org_id}/{pname}"
try:
os.makedirs(ws_dir, exist_ok=True)
except Exception:
ws_dir = f"/tmp/pipeline_workspaces/{pname}"
ws_dir = f"/tmp/pipeline_ws/{pname}"
os.makedirs(ws_dir, exist_ok=True)
await sor.C('sd_projects', {
'id': pid, 'name': pname, 'description': intent.get('description', ''),