@@ -56,7 +56,8 @@ function registerNewFiles(
5656 fs : VirtualFileSystem ,
5757 newFileContents : NewFileZipContents [ ] ,
5858 uploadId : string ,
59- workspaceFolders : CurrentWsFolders
59+ workspaceFolders : CurrentWsFolders ,
60+ conversationId : string
6061) : NewFileInfo [ ] {
6162 const result : NewFileInfo [ ] = [ ]
6263 const workspaceFolderPrefixes = getWorkspaceFoldersByPrefixes ( workspaceFolders )
@@ -70,6 +71,10 @@ function registerNewFiles(
7071 workspaceFolderPrefixes === undefined ? '' : zipFilePath . substring ( 0 , zipFilePath . indexOf ( path . sep ) )
7172 const folder = workspaceFolderPrefixes === undefined ? workspaceFolders [ 0 ] : workspaceFolderPrefixes [ prefix ]
7273 if ( folder === undefined ) {
74+ telemetry . amazonq_wsOrphanedDocuments . emit ( {
75+ amazonqConversationId : conversationId ,
76+ credentialStartUrl : AuthUtil . instance . startUrl ,
77+ } )
7378 getLogger ( ) . error ( `No workspace folder found for file: ${ zipFilePath } and prefix: ${ prefix } ` )
7479 continue
7580 }
@@ -161,7 +166,13 @@ abstract class CodeGenBase {
161166 case CodeGenerationStatus . COMPLETE : {
162167 const { newFileContents, deletedFiles, references } =
163168 await this . config . proxyClient . exportResultArchive ( this . conversationId )
164- const newFileInfo = registerNewFiles ( fs , newFileContents , this . uploadId , workspaceFolders )
169+ const newFileInfo = registerNewFiles (
170+ fs ,
171+ newFileContents ,
172+ this . uploadId ,
173+ workspaceFolders ,
174+ this . conversationId
175+ )
165176 telemetry . setNumberOfFilesGenerated ( newFileInfo . length )
166177
167178 return {
@@ -348,7 +359,13 @@ export class MockCodeGenState implements SessionState {
348359 zipFilePath : f . zipFilePath ,
349360 fileContent : f . fileContent ,
350361 } ) )
351- this . filePaths = registerNewFiles ( action . fs , newFileContents , this . uploadId , this . config . workspaceFolders )
362+ this . filePaths = registerNewFiles (
363+ action . fs ,
364+ newFileContents ,
365+ this . uploadId ,
366+ this . config . workspaceFolders ,
367+ this . conversationId
368+ )
352369 this . deletedFiles = [
353370 {
354371 zipFilePath : 'src/this-file-should-be-deleted.ts' ,
0 commit comments