From: Codebuddy Date: Mon, 17 Aug 2026 03:27:48 +0000 (+0800) Subject: fix: 已上传文件按 task_id 正确解析所属会话任务名(load_tasks 实为 {tasks:[...]}) X-Git-Url: http://acesimba.cloud/gitweb/?a=commitdiff_plain;h=e7c17da82bee3b1b39d92c07d462a85e7cb45927;p=codebuddy-web.git fix: 已上传文件按 task_id 正确解析所属会话任务名(load_tasks 实为 {tasks:[...]}) --- diff --git a/backend/app.py b/backend/app.py index 1d88ed9..261bb18 100644 --- a/backend/app.py +++ b/backend/app.py @@ -813,7 +813,8 @@ async def list_uploads(request: Request): if not _auth_ok(request): return JSONResponse({"error": "unauthorized"}, status_code=401) try: - tasks = load_tasks() + tasks = load_tasks().get("tasks", []) + task_map = {t.get("id"): t.get("name", "") for t in tasks} idx = load_uploads_index() files = [] if PASTES_DIR.exists(): @@ -829,8 +830,8 @@ async def list_uploads(request: Request): kind = "zip" tid = idx.get(p.name, "") tname = "" - if tid and tid in tasks: - tname = tasks[tid].get("name", "") or "" + if tid and tid in task_map: + tname = task_map.get(tid, "") or "" st = p.stat() files.append({ "name": p.name, "path": str(p),