refactor(workflow): enforce strict nested type safety for WorkflowTaskPayload

This commit is contained in:
yiling
2026-05-28 09:48:05 +08:00
parent 911e369782
commit 11d2e89a48
18 changed files with 185 additions and 98 deletions
+9 -2
View File
@@ -43,7 +43,11 @@ describe('Agent Chat Workflow', () => {
deleteCommentActivity: Object.assign(vi.fn(), { _activityName: 'deleteCommentActivity' }),
}
mockActivities.getCommentActivity.mockResolvedValue({ id: 'c1', message: 'hello', replyToId: null })
mockActivities.getCommentActivity.mockResolvedValue({
id: 'c1',
message: 'hello',
replyToId: null,
})
mockActivities.createCommentActivity.mockResolvedValue({ id: 'comment-placeholder-id' })
mockActivities.getAssetActivity.mockResolvedValue({ id: 'a1', project: { teamId: 't1' } })
mockActivities.initializeAgentSessionActivity.mockResolvedValue('session-123')
@@ -67,7 +71,10 @@ describe('Agent Chat Workflow', () => {
type: 'chat',
status: 'pending',
assetId: 'a1',
payload: { userCommentId: 'c1', agentId: 'b1' },
payload: {
projectId: 'p1',
agent: { userCommentId: 'c1', agentId: 'b1' },
},
},
})