@@ -273,11 +273,12 @@ export class CodeGenState extends CodeGenBase implements SessionState {
273273
274274 action . telemetry . setGenerateCodeIteration ( this . currentIteration )
275275 action . telemetry . setGenerateCodeLastInvocationTime ( )
276-
277- const { codeGenerationId } = await this . config . proxyClient . startCodeGeneration (
276+ const codeGenerationId = randomUUID ( )
277+ await this . config . proxyClient . startCodeGeneration (
278278 this . config . conversationId ,
279279 this . config . uploadId ,
280280 action . msg ,
281+ codeGenerationId ,
281282 this . currentCodeGenerationId
282283 )
283284
@@ -457,41 +458,40 @@ export class PrepareCodeGenState implements SessionState {
457458 } )
458459
459460 action . messenger . sendUpdatePlaceholder ( this . tabID , i18n ( 'AWS.amazonq.featureDev.pillText.uploadingCode' ) )
460- if ( ! this . uploadId ) {
461- const uploadId = await telemetry . amazonq_createUpload . run ( async ( span ) => {
462- span . record ( {
463- amazonqConversationId : this . config . conversationId ,
464- credentialStartUrl : AuthUtil . instance . startUrl ,
465- } )
466- const { zipFileBuffer, zipFileChecksum } = await prepareRepoData (
467- this . config . workspaceRoots ,
468- this . config . workspaceFolders ,
469- action . telemetry ,
470- span
471- )
461+ const uploadId = await telemetry . amazonq_createUpload . run ( async ( span ) => {
462+ span . record ( {
463+ amazonqConversationId : this . config . conversationId ,
464+ credentialStartUrl : AuthUtil . instance . startUrl ,
465+ } )
466+ const { zipFileBuffer, zipFileChecksum } = await prepareRepoData (
467+ this . config . workspaceRoots ,
468+ this . config . workspaceFolders ,
469+ action . telemetry ,
470+ span
471+ )
472472
473- const { uploadUrl, uploadId, kmsKeyArn } = await this . config . proxyClient . createUploadUrl (
474- this . config . conversationId ,
475- zipFileChecksum ,
476- zipFileBuffer . length
477- )
473+ const { uploadUrl, uploadId, kmsKeyArn } = await this . config . proxyClient . createUploadUrl (
474+ this . config . conversationId ,
475+ zipFileChecksum ,
476+ zipFileBuffer . length
477+ )
478478
479- await uploadCode ( uploadUrl , zipFileBuffer , zipFileChecksum , kmsKeyArn )
480- action . messenger . sendAnswer ( {
481- message : i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' ) ,
482- type : 'answer-part' ,
483- tabID : this . tabID ,
484- } )
479+ await uploadCode ( uploadUrl , zipFileBuffer , zipFileChecksum , kmsKeyArn )
480+ action . messenger . sendAnswer ( {
481+ message : i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' ) ,
482+ type : 'answer-part' ,
483+ tabID : this . tabID ,
484+ } )
485485
486- action . messenger . sendUpdatePlaceholder (
487- this . tabID ,
488- i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' )
489- )
486+ action . messenger . sendUpdatePlaceholder (
487+ this . tabID ,
488+ i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' )
489+ )
490+
491+ return uploadId
492+ } )
493+ this . uploadId = uploadId
490494
491- return uploadId
492- } )
493- this . uploadId = uploadId
494- }
495495 const nextState = new CodeGenState (
496496 { ...this . config , uploadId : this . uploadId , currentCodeGenerationId : this . currentCodeGenerationId } ,
497497 this . filePaths ,
0 commit comments