feat(cowork-service): map enriched checkpoint refs and IPC ids
This commit is contained in:
parent
41673125af
commit
32b46f0625
@ -55,6 +55,9 @@ describe('agent runtime routes', () => {
|
|||||||
currentTaskId: 'task-1',
|
currentTaskId: 'task-1',
|
||||||
createdAt: '2026-04-04T08:00:00.000Z',
|
createdAt: '2026-04-04T08:00:00.000Z',
|
||||||
updatedAt: '2026-04-04T08:05:00.000Z',
|
updatedAt: '2026-04-04T08:05:00.000Z',
|
||||||
|
artifactRefs: ['artifact://notelett/note-1'],
|
||||||
|
memoryRefs: ['memory://mindlyst/memory-1'],
|
||||||
|
approvalRefs: ['approval://cowork/ap-1'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -69,6 +72,9 @@ describe('agent runtime routes', () => {
|
|||||||
productId: 'clawcowork',
|
productId: 'clawcowork',
|
||||||
currentTaskId: 'task-1',
|
currentTaskId: 'task-1',
|
||||||
status: 'active',
|
status: 'active',
|
||||||
|
artifactRefs: ['artifact://notelett/note-1'],
|
||||||
|
memoryRefs: ['memory://mindlyst/memory-1'],
|
||||||
|
approvalRefs: ['approval://cowork/ap-1'],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -82,7 +88,7 @@ describe('agent runtime routes', () => {
|
|||||||
createdAt: '2026-04-04T08:00:00.000Z',
|
createdAt: '2026-04-04T08:00:00.000Z',
|
||||||
updatedAt: '2026-04-04T08:10:00.000Z',
|
updatedAt: '2026-04-04T08:10:00.000Z',
|
||||||
sessionId: 'sess-1',
|
sessionId: 'sess-1',
|
||||||
correlationId: 'corr-1',
|
eventId: 'evt_cowork_task_task-1',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -96,7 +102,7 @@ describe('agent runtime routes', () => {
|
|||||||
sessionId: 'sess-1',
|
sessionId: 'sess-1',
|
||||||
productId: 'clawcowork',
|
productId: 'clawcowork',
|
||||||
status: 'running',
|
status: 'running',
|
||||||
correlationId: 'corr-1',
|
correlationId: 'evt_cowork_task_task-1',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -226,6 +232,9 @@ describe('agent runtime routes', () => {
|
|||||||
completed: false,
|
completed: false,
|
||||||
cancelled: false,
|
cancelled: false,
|
||||||
completed_tool_calls: 2,
|
completed_tool_calls: 2,
|
||||||
|
artifact_refs: ['artifact://notelett/note-1'],
|
||||||
|
memory_refs: ['memory://mindlyst/memory-1'],
|
||||||
|
approval_refs: ['approval://cowork/ap-1'],
|
||||||
error: null,
|
error: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -242,6 +251,9 @@ describe('agent runtime routes', () => {
|
|||||||
userId: 'demo-user',
|
userId: 'demo-user',
|
||||||
statusAtCapture: 'queued',
|
statusAtCapture: 'queued',
|
||||||
resumeToken: 'task-1',
|
resumeToken: 'task-1',
|
||||||
|
artifactRefs: ['artifact://notelett/note-1'],
|
||||||
|
memoryRefs: ['memory://mindlyst/memory-1'],
|
||||||
|
approvalRefs: ['approval://cowork/ap-1'],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -79,9 +79,15 @@ function toAgentSession(session: Record<string, unknown>, fallbackNow: string):
|
|||||||
typeof session.currentTaskId === 'string' && session.currentTaskId.length > 0
|
typeof session.currentTaskId === 'string' && session.currentTaskId.length > 0
|
||||||
? session.currentTaskId
|
? session.currentTaskId
|
||||||
: null,
|
: null,
|
||||||
memoryRefs: [],
|
memoryRefs: Array.isArray(session.memoryRefs)
|
||||||
artifactRefs: [],
|
? session.memoryRefs.filter((value): value is string => typeof value === 'string')
|
||||||
approvalRefs: [],
|
: [],
|
||||||
|
artifactRefs: Array.isArray(session.artifactRefs)
|
||||||
|
? session.artifactRefs.filter((value): value is string => typeof value === 'string')
|
||||||
|
: [],
|
||||||
|
approvalRefs: Array.isArray(session.approvalRefs)
|
||||||
|
? session.approvalRefs.filter((value): value is string => typeof value === 'string')
|
||||||
|
: [],
|
||||||
dispatchContext: {
|
dispatchContext: {
|
||||||
originSurface: 'desktop',
|
originSurface: 'desktop',
|
||||||
originProductId: PRODUCT_ID,
|
originProductId: PRODUCT_ID,
|
||||||
@ -113,9 +119,11 @@ function toAgentRun(task: Record<string, unknown>, fallbackNow: string): AgentRu
|
|||||||
correlationId:
|
correlationId:
|
||||||
typeof task.correlationId === 'string'
|
typeof task.correlationId === 'string'
|
||||||
? task.correlationId
|
? task.correlationId
|
||||||
: typeof task.id === 'string'
|
: typeof task.eventId === 'string'
|
||||||
? task.id
|
? task.eventId
|
||||||
: null,
|
: typeof task.id === 'string'
|
||||||
|
? task.id
|
||||||
|
: null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,9 +293,15 @@ function toAgentCheckpoint(
|
|||||||
statusAtCapture: mapCheckpointStatus(task, checkpoint),
|
statusAtCapture: mapCheckpointStatus(task, checkpoint),
|
||||||
currentTaskId: taskId,
|
currentTaskId: taskId,
|
||||||
todoIds: [`todo_${taskId}`],
|
todoIds: [`todo_${taskId}`],
|
||||||
artifactRefs: [],
|
artifactRefs: Array.isArray(checkpoint.artifact_refs)
|
||||||
memoryRefs: [],
|
? checkpoint.artifact_refs.filter((value): value is string => typeof value === 'string')
|
||||||
approvalRefs: [],
|
: [],
|
||||||
|
memoryRefs: Array.isArray(checkpoint.memory_refs)
|
||||||
|
? checkpoint.memory_refs.filter((value): value is string => typeof value === 'string')
|
||||||
|
: [],
|
||||||
|
approvalRefs: Array.isArray(checkpoint.approval_refs)
|
||||||
|
? checkpoint.approval_refs.filter((value): value is string => typeof value === 'string')
|
||||||
|
: [],
|
||||||
dispatchContext: {
|
dispatchContext: {
|
||||||
originSurface: 'desktop',
|
originSurface: 'desktop',
|
||||||
originProductId: PRODUCT_ID,
|
originProductId: PRODUCT_ID,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user