From 1c1587c8160161ab240d9836347d0630c593109a Mon Sep 17 00:00:00 2001 From: cfdaily Date: Mon, 18 May 2026 23:26:12 +0800 Subject: [PATCH] auto-sync: 2026-05-18 23:26:12 --- src/api/blackboard_routes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/api/blackboard_routes.py b/src/api/blackboard_routes.py index b53b3c1..c62f290 100644 --- a/src/api/blackboard_routes.py +++ b/src/api/blackboard_routes.py @@ -66,8 +66,13 @@ async def get_task(project_id: str, task_id: str, @router.post("/tasks") async def create_task(project_id: str, body: Dict[str, Any]): bb = _bb(project_id) + # v2.8: title 为空时自动生成 + title = body.get("title", "") + if not title or not title.strip(): + desc = body.get("description", "") or "" + title = (desc[:30] + "…") if len(desc) > 30 else (desc or "新军令") task = Task( - id=body["id"], title=body["title"], + id=body["id"], title=title, description=body.get("description"), task_type=body.get("task_type", "coding"), priority=body.get("priority", 5), @@ -80,7 +85,7 @@ async def create_task(project_id: str, body: Dict[str, Any]): stages_json=body.get("stages_json", "[]"), ) bb.create_task(task) - return {"ok": True, "task_id": task.id} + return {"ok": True, "task_id": task.id, "title": task.title} @router.get("/tasks/{task_id}/progress")