diff --git a/backend/app/services/task_service.py b/backend/app/services/task_service.py index 68b1831..f8c7304 100644 --- a/backend/app/services/task_service.py +++ b/backend/app/services/task_service.py @@ -217,8 +217,8 @@ async def get_all_tasks( result = await db.execute(stmt) tasks = result.scalars().all() - # 构造嵌套响应时只返回顶层任务 - all_tasks = [_to_response(t) for t in tasks if t.parent_task_id is None] + # 返回所有匹配的任务(含子任务),不再过滤 parent_task_id + all_tasks = [_to_response(t) for t in tasks] return TaskListResponse(tasks=all_tasks, total=len(all_tasks))