From d6773f922a74387d983914a8225ccdb33727b1a2 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 13:18:22 +0800 Subject: [PATCH 01/14] { "tool": "Edit", "files": [ "apps/server/src/core/lua-scripts.ts" ], "tasks": [ { "id": "t-1758604556727", "text": "Allow status transition from completed back to pending/in_progress for project tasks" }, { "id": "t-1758604613134", "text": "Modify handler to check for project tasks" } ], "todos": [], "sessionId": "566fe3b4-47c5-4f46-b2a8-f9a51509705d", "instanceId": "worker-1", "timestamp": 1758604702059 } --- apps/server/src/core/lua-scripts.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/server/src/core/lua-scripts.ts b/apps/server/src/core/lua-scripts.ts index f7df8c1..e01501d 100644 --- a/apps/server/src/core/lua-scripts.ts +++ b/apps/server/src/core/lua-scripts.ts @@ -634,9 +634,19 @@ local updates = cjson.decode(updates_json) local current_status = redis.call('hget', task_key, 'status') local current_priority = tonumber(redis.call('hget', task_key, 'priority')) --- CRITICAL: Prevent regression of completed tasks (but allow retry of failed tasks) +-- Check if this is a project task (has projectId or type='project' in metadata) +local is_project_task = false +local metadata_str = redis.call('hget', task_key, 'metadata') +if metadata_str then + local metadata = cjson.decode(metadata_str) + if metadata.projectId or metadata.type == 'project' then + is_project_task = true + end +end + +-- CRITICAL: Prevent regression of completed tasks (but allow retry of failed tasks and project tasks) if current_status == 'completed' and updates.status then - if updates.status ~= 'completed' then + if updates.status ~= 'completed' and not is_project_task then return {0, 'Cannot change status of completed task to ' .. updates.status} end end From 34e483f0d784f4229f6f7bf73f28af15cf8c1ad7 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 13:20:20 +0800 Subject: [PATCH 02/14] { "tool": "Edit", "files": [ "apps/server/tests/contract/task.update.contract.test.ts" ], "tasks": [ { "id": "t-1758604556727", "text": "Allow status transition from completed back to pending/in_progress for project tasks" }, { "id": "t-1758604613165", "text": "Write tests to verify the new behavior" } ], "todos": [], "sessionId": "566fe3b4-47c5-4f46-b2a8-f9a51509705d", "instanceId": "worker-1", "timestamp": 1758604820567 } --- .../contract/task.update.contract.test.ts | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/apps/server/tests/contract/task.update.contract.test.ts b/apps/server/tests/contract/task.update.contract.test.ts index 5fa1634..9a16960 100644 --- a/apps/server/tests/contract/task.update.contract.test.ts +++ b/apps/server/tests/contract/task.update.contract.test.ts @@ -186,6 +186,103 @@ describe("Contract Validation: task.update", () => { await expect(registry.executeHandler("task.update", input)).rejects.toThrow(); }); + it("should allow completed project tasks to transition back to pending", async () => { + // Create a project task + const projectTaskResult = await registry.executeHandler("task.create", { + text: "Project task for transition test", + priority: 80, + metadata: { + projectId: "proj-test-123", + type: "project" + } + }); + const projectTaskId = projectTaskResult.id; + + // Complete the project task + await registry.executeHandler("task.update", { + id: projectTaskId, + updates: { status: "completed" as const } + }); + + // Verify it's completed + const taskKey = `cb:task:${projectTaskId}`; + let storedTask = await redis.stream.hgetall(taskKey); + expect(storedTask.status).toBe("completed"); + + // Now transition back to pending (should succeed for project task) + const result = await registry.executeHandler("task.update", { + id: projectTaskId, + updates: { status: "pending" as const } + }); + + expect(result.status).toBe("pending"); + + // Verify in Redis + storedTask = await redis.stream.hgetall(taskKey); + expect(storedTask.status).toBe("pending"); + }); + + it("should allow completed project tasks with only projectId to transition", async () => { + // Create a task with just projectId (not type: 'project') + const projectTaskResult = await registry.executeHandler("task.create", { + text: "Subtask with projectId", + priority: 70, + metadata: { + projectId: "proj-another-123", + type: "subtask" + } + }); + const projectTaskId = projectTaskResult.id; + + // Complete the task + await registry.executeHandler("task.update", { + id: projectTaskId, + updates: { status: "completed" as const } + }); + + // Transition back to in_progress (should succeed due to projectId) + const result = await registry.executeHandler("task.update", { + id: projectTaskId, + updates: { status: "in_progress" as const } + }); + + expect(result.status).toBe("in_progress"); + }); + + it("should block completed non-project tasks from transitioning back", async () => { + // Create a regular task (no projectId or type='project') + const regularTaskResult = await registry.executeHandler("task.create", { + text: "Regular task - no transitions allowed", + priority: 60, + metadata: { + category: "regular" + } + }); + const regularTaskId = regularTaskResult.id; + + // Complete the regular task + await registry.executeHandler("task.update", { + id: regularTaskId, + updates: { status: "completed" as const } + }); + + // Try to transition back to pending (should fail for regular task) + await expect( + registry.executeHandler("task.update", { + id: regularTaskId, + updates: { status: "pending" as const } + }) + ).rejects.toThrow("Cannot change status of completed task to pending"); + + // Try to transition to in_progress (should also fail) + await expect( + registry.executeHandler("task.update", { + id: regularTaskId, + updates: { status: "in_progress" as const } + }) + ).rejects.toThrow("Cannot change status of completed task to in_progress"); + }); + it("should publish update event to Redis stream", async () => { const input = { id: testTaskId, From 6889075b4ac8925b29f603bfdaf2a6147a37fec7 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 13:38:03 +0800 Subject: [PATCH 03/14] { "tool": "Edit", "files": [ "apps/server/src/schemas/task.schema.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758605883808 } --- apps/server/src/schemas/task.schema.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/server/src/schemas/task.schema.ts b/apps/server/src/schemas/task.schema.ts index 5a85163..485e269 100644 --- a/apps/server/src/schemas/task.schema.ts +++ b/apps/server/src/schemas/task.schema.ts @@ -143,6 +143,12 @@ export const taskListOutput = z.object({ completedAt: z.string().datetime().nullable(), attachmentCount: z.number().int().min(0).default(0), attachmentKeys: z.array(z.string()).optional(), + resultAttachment: z.object({ + type: z.string(), + value: z.unknown().optional(), + content: z.string().optional(), + createdAt: z.string() + }).nullable().optional(), })), totalCount: z.number(), hasMore: z.boolean(), From 8e441da90b0f08ae1fe965736b5fafefce502d89 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 13:38:40 +0800 Subject: [PATCH 04/14] { "tool": "Edit", "files": [ "apps/server/src/handlers/task/task.list.handler.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758605920231 } --- .../src/handlers/task/task.list.handler.ts | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/apps/server/src/handlers/task/task.list.handler.ts b/apps/server/src/handlers/task/task.list.handler.ts index 5a007a2..0dc826d 100644 --- a/apps/server/src/handlers/task/task.list.handler.ts +++ b/apps/server/src/handlers/task/task.list.handler.ts @@ -81,24 +81,44 @@ export class TaskListHandler { const attachmentsIndexKey = `cb:task:${task.id}:attachments`; let attachmentCount = 0; let attachmentKeys: string[] = []; + let resultAttachment = null; try { // Get attachment count from Redis attachmentCount = await ctx.redis.pub.zcard(attachmentsIndexKey); - // Also get attachment keys for discovery + // Also get attachment keys for discovery and fetch result attachment if (attachmentCount > 0 && ctx.prisma) { const attachments = await ctx.prisma.taskAttachment.findMany({ where: { taskId: task.id }, - select: { key: true }, + select: { + key: true, + type: true, + value: true, + content: true, + createdAt: true + }, take: 20 // Limit keys to prevent response bloat }); + attachmentKeys = attachments.map(a => a.key); + + // Find and include the "result" attachment content if it exists + const resultAtt = attachments.find(a => a.key === 'result'); + if (resultAtt) { + resultAttachment = { + type: resultAtt.type, + value: resultAtt.value, + content: resultAtt.content, + createdAt: resultAtt.createdAt.toISOString() + }; + } } } catch (error) { // Silently handle errors - attachment info is non-critical for listing attachmentCount = 0; attachmentKeys = []; + resultAttachment = null; } return { @@ -110,6 +130,7 @@ export class TaskListHandler { completedAt: task.completedAt ? task.completedAt.toISOString() : null, attachmentCount, attachmentKeys, // Include keys for discovery + resultAttachment, // Include result attachment content }; }) ); From 39bdadbc2da4221d666ce0f0207c00def768d225 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 13:40:23 +0800 Subject: [PATCH 05/14] { "tool": "Edit", "files": [ "apps/server/src/schemas/task.schema.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758606022983 } --- apps/server/src/schemas/task.schema.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/server/src/schemas/task.schema.ts b/apps/server/src/schemas/task.schema.ts index 485e269..2e2d4f3 100644 --- a/apps/server/src/schemas/task.schema.ts +++ b/apps/server/src/schemas/task.schema.ts @@ -144,10 +144,10 @@ export const taskListOutput = z.object({ attachmentCount: z.number().int().min(0).default(0), attachmentKeys: z.array(z.string()).optional(), resultAttachment: z.object({ - type: z.string(), - value: z.unknown().optional(), + type: AttachmentType, + value: z.any().optional(), content: z.string().optional(), - createdAt: z.string() + createdAt: z.string().datetime() }).nullable().optional(), })), totalCount: z.number(), From 5f6708f427cdf7bc1514870aed0c69f7341dd8fb Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 13:40:35 +0800 Subject: [PATCH 06/14] { "tool": "Edit", "files": [ "apps/server/src/handlers/task/task.list.handler.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758606035309 } --- apps/server/src/handlers/task/task.list.handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/server/src/handlers/task/task.list.handler.ts b/apps/server/src/handlers/task/task.list.handler.ts index 0dc826d..cb0b6c3 100644 --- a/apps/server/src/handlers/task/task.list.handler.ts +++ b/apps/server/src/handlers/task/task.list.handler.ts @@ -108,8 +108,8 @@ export class TaskListHandler { if (resultAtt) { resultAttachment = { type: resultAtt.type, - value: resultAtt.value, - content: resultAtt.content, + value: resultAtt.value || undefined, + content: resultAtt.content || undefined, createdAt: resultAtt.createdAt.toISOString() }; } From d6b72587753265947bf5185f267261d7381dce75 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 13:42:33 +0800 Subject: [PATCH 07/14] { "tool": "Edit", "files": [ "apps/server/src/schemas/task.schema.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758606153153 } --- apps/server/src/schemas/task.schema.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/server/src/schemas/task.schema.ts b/apps/server/src/schemas/task.schema.ts index 2e2d4f3..83a8a1c 100644 --- a/apps/server/src/schemas/task.schema.ts +++ b/apps/server/src/schemas/task.schema.ts @@ -117,6 +117,15 @@ export const taskClaimOutput = z.object({ export type TaskClaimInput = z.infer; export type TaskClaimOutput = z.infer; +// Attachment type enum (moved before task.list to fix ordering) +export const AttachmentType = z.enum([ + "json", + "markdown", + "text", + "url", + "binary", +]); + // task.list - NEW for listing/filtering tasks export const taskListInput = z.object({ status: TaskStatus.optional(), @@ -157,15 +166,6 @@ export const taskListOutput = z.object({ export type TaskListInput = z.infer; export type TaskListOutput = z.infer; -// Attachment type enum -export const AttachmentType = z.enum([ - "json", - "markdown", - "text", - "url", - "binary", -]); - // task.create_attachment export const taskCreateAttachmentInput = z.object({ taskId: z.string().min(1), From f8ff1f24a5288212e3b23a068378d51e740cdf0e Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 14:01:03 +0800 Subject: [PATCH 08/14] { "tool": "Edit", "files": [ "apps/server/src/schemas/task.schema.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758607263885 } --- apps/server/src/schemas/task.schema.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/server/src/schemas/task.schema.ts b/apps/server/src/schemas/task.schema.ts index 83a8a1c..a8a8b5c 100644 --- a/apps/server/src/schemas/task.schema.ts +++ b/apps/server/src/schemas/task.schema.ts @@ -147,16 +147,16 @@ export const taskListOutput = z.object({ metadata: z.record(z.string(), z.unknown()).nullable(), result: z.unknown().nullable(), error: z.string().nullable(), - createdAt: z.string().datetime(), - updatedAt: z.string().datetime(), - completedAt: z.string().datetime().nullable(), + createdAt: z.string().datetime().optional(), + updatedAt: z.string().datetime().optional(), + completedAt: z.string().datetime().nullable().optional(), attachmentCount: z.number().int().min(0).default(0), attachmentKeys: z.array(z.string()).optional(), resultAttachment: z.object({ type: AttachmentType, value: z.any().optional(), content: z.string().optional(), - createdAt: z.string().datetime() + createdAt: z.string().datetime().optional() }).nullable().optional(), })), totalCount: z.number(), From d1042a7e71be78c318690dc25c508420b305a816 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 14:01:16 +0800 Subject: [PATCH 09/14] { "tool": "Edit", "files": [ "apps/server/src/schemas/task.schema.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758607276625 } --- apps/server/src/schemas/task.schema.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/server/src/schemas/task.schema.ts b/apps/server/src/schemas/task.schema.ts index a8a8b5c..6a02d1b 100644 --- a/apps/server/src/schemas/task.schema.ts +++ b/apps/server/src/schemas/task.schema.ts @@ -135,6 +135,7 @@ export const taskListInput = z.object({ offset: z.number().int().min(0).default(0), orderBy: z.enum(["createdAt", "updatedAt", "priority", "status", "assignedTo"]).default("createdAt"), order: z.enum(["asc", "desc"]).default("desc"), + includeTimestamps: z.boolean().optional().default(false), }); export const taskListOutput = z.object({ From d339b612c9509878bea1c0a12d18fca735e43c15 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 14:01:49 +0800 Subject: [PATCH 10/14] { "tool": "Edit", "files": [ "apps/server/src/handlers/task/task.list.handler.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758607309282 } --- .../src/handlers/task/task.list.handler.ts | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/server/src/handlers/task/task.list.handler.ts b/apps/server/src/handlers/task/task.list.handler.ts index cb0b6c3..1273c62 100644 --- a/apps/server/src/handlers/task/task.list.handler.ts +++ b/apps/server/src/handlers/task/task.list.handler.ts @@ -121,17 +121,34 @@ export class TaskListHandler { resultAttachment = null; } - return { + const taskData: any = { ...task, metadata: task.metadata as Record | null, result: task.result as unknown, - createdAt: task.createdAt.toISOString(), - updatedAt: task.updatedAt.toISOString(), - completedAt: task.completedAt ? task.completedAt.toISOString() : null, attachmentCount, attachmentKeys, // Include keys for discovery - resultAttachment, // Include result attachment content }; + + // Only include timestamps if requested + if (input.includeTimestamps) { + taskData.createdAt = task.createdAt.toISOString(); + taskData.updatedAt = task.updatedAt.toISOString(); + taskData.completedAt = task.completedAt ? task.completedAt.toISOString() : null; + + // Also include timestamp in result attachment if it exists + if (resultAttachment) { + resultAttachment.createdAt = resultAtt.createdAt.toISOString(); + } + } + + // Add result attachment (with or without timestamp based on above) + if (resultAttachment) { + taskData.resultAttachment = resultAttachment; + } else { + taskData.resultAttachment = null; + } + + return taskData; }) ); From 6f0853b0fbf06371f1b4c06f72ba3c39754a6417 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 14:02:00 +0800 Subject: [PATCH 11/14] { "tool": "Edit", "files": [ "apps/server/src/handlers/task/task.list.handler.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758607320898 } --- apps/server/src/handlers/task/task.list.handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/handlers/task/task.list.handler.ts b/apps/server/src/handlers/task/task.list.handler.ts index 1273c62..5fc7684 100644 --- a/apps/server/src/handlers/task/task.list.handler.ts +++ b/apps/server/src/handlers/task/task.list.handler.ts @@ -110,7 +110,7 @@ export class TaskListHandler { type: resultAtt.type, value: resultAtt.value || undefined, content: resultAtt.content || undefined, - createdAt: resultAtt.createdAt.toISOString() + // We'll add createdAt conditionally later based on includeTimestamps }; } } From 5f0161d1119791fbc832524a38d5593e6d927906 Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 14:02:12 +0800 Subject: [PATCH 12/14] { "tool": "Edit", "files": [ "apps/server/src/handlers/task/task.list.handler.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758607332409 } --- apps/server/src/handlers/task/task.list.handler.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/server/src/handlers/task/task.list.handler.ts b/apps/server/src/handlers/task/task.list.handler.ts index 5fc7684..f7fb630 100644 --- a/apps/server/src/handlers/task/task.list.handler.ts +++ b/apps/server/src/handlers/task/task.list.handler.ts @@ -134,11 +134,6 @@ export class TaskListHandler { taskData.createdAt = task.createdAt.toISOString(); taskData.updatedAt = task.updatedAt.toISOString(); taskData.completedAt = task.completedAt ? task.completedAt.toISOString() : null; - - // Also include timestamp in result attachment if it exists - if (resultAttachment) { - resultAttachment.createdAt = resultAtt.createdAt.toISOString(); - } } // Add result attachment (with or without timestamp based on above) From 88c0f6c110e1f4c50c47f89d3225d2e9206b72aa Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 14:02:33 +0800 Subject: [PATCH 13/14] { "tool": "Edit", "files": [ "apps/server/src/handlers/task/task.list.handler.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758607353561 } --- apps/server/src/handlers/task/task.list.handler.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/server/src/handlers/task/task.list.handler.ts b/apps/server/src/handlers/task/task.list.handler.ts index f7fb630..b136355 100644 --- a/apps/server/src/handlers/task/task.list.handler.ts +++ b/apps/server/src/handlers/task/task.list.handler.ts @@ -81,7 +81,8 @@ export class TaskListHandler { const attachmentsIndexKey = `cb:task:${task.id}:attachments`; let attachmentCount = 0; let attachmentKeys: string[] = []; - let resultAttachment = null; + let resultAttachment: any = null; + let resultAttachmentData: any = null; try { // Get attachment count from Redis @@ -106,12 +107,18 @@ export class TaskListHandler { // Find and include the "result" attachment content if it exists const resultAtt = attachments.find(a => a.key === 'result'); if (resultAtt) { + // Store the raw attachment data for later + resultAttachmentData = resultAtt; resultAttachment = { type: resultAtt.type, value: resultAtt.value || undefined, content: resultAtt.content || undefined, - // We'll add createdAt conditionally later based on includeTimestamps }; + + // Add timestamp only if requested + if (input.includeTimestamps) { + resultAttachment.createdAt = resultAtt.createdAt.toISOString(); + } } } } catch (error) { From 4ef81726f37ab46ae6cbb5327f7a999422eb120e Mon Sep 17 00:00:00 2001 From: FBLGit Date: Tue, 23 Sep 2025 14:14:11 +0800 Subject: [PATCH 14/14] { "tool": "Edit", "files": [ "apps/server/src/handlers/task/task.list.handler.ts" ], "tasks": [ { "id": "t-1758601257866", "text": "Design and implement database schema for DIL documents and blocks storage" } ], "todos": [], "sessionId": "7394b349-02b7-400f-8fdb-d49dc2f4a908", "instanceId": "worker-2", "timestamp": 1758608050945 } --- apps/server/src/handlers/task/task.list.handler.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/server/src/handlers/task/task.list.handler.ts b/apps/server/src/handlers/task/task.list.handler.ts index b136355..2a384e1 100644 --- a/apps/server/src/handlers/task/task.list.handler.ts +++ b/apps/server/src/handlers/task/task.list.handler.ts @@ -128,10 +128,16 @@ export class TaskListHandler { resultAttachment = null; } + // Build task data without including Date objects const taskData: any = { - ...task, + id: task.id, + text: task.text, + status: task.status, + priority: task.priority, + assignedTo: task.assignedTo, metadata: task.metadata as Record | null, result: task.result as unknown, + error: task.error, attachmentCount, attachmentKeys, // Include keys for discovery };