@@ -281,11 +281,12 @@ export class CodeGenState extends CodeGenBase implements SessionState {
281281
282282 action . telemetry . setGenerateCodeIteration ( this . currentIteration )
283283 action . telemetry . setGenerateCodeLastInvocationTime ( )
284-
285- const { codeGenerationId } = await this . config . proxyClient . startCodeGeneration (
284+ const codeGenerationId = randomUUID ( )
285+ await this . config . proxyClient . startCodeGeneration (
286286 this . config . conversationId ,
287287 this . config . uploadId ,
288288 action . msg ,
289+ codeGenerationId ,
289290 this . currentCodeGenerationId
290291 )
291292
@@ -465,41 +466,40 @@ export class PrepareCodeGenState implements SessionState {
465466 } )
466467
467468 action . messenger . sendUpdatePlaceholder ( this . tabID , i18n ( 'AWS.amazonq.featureDev.pillText.uploadingCode' ) )
468- if ( ! this . uploadId ) {
469- const uploadId = await telemetry . amazonq_createUpload . run ( async ( span ) => {
470- span . record ( {
471- amazonqConversationId : this . config . conversationId ,
472- credentialStartUrl : AuthUtil . instance . startUrl ,
473- } )
474- const { zipFileBuffer, zipFileChecksum } = await prepareRepoData (
475- this . config . workspaceRoots ,
476- this . config . workspaceFolders ,
477- action . telemetry ,
478- span
479- )
469+ const uploadId = await telemetry . amazonq_createUpload . run ( async ( span ) => {
470+ span . record ( {
471+ amazonqConversationId : this . config . conversationId ,
472+ credentialStartUrl : AuthUtil . instance . startUrl ,
473+ } )
474+ const { zipFileBuffer, zipFileChecksum } = await prepareRepoData (
475+ this . config . workspaceRoots ,
476+ this . config . workspaceFolders ,
477+ action . telemetry ,
478+ span
479+ )
480480
481- const { uploadUrl, uploadId, kmsKeyArn } = await this . config . proxyClient . createUploadUrl (
482- this . config . conversationId ,
483- zipFileChecksum ,
484- zipFileBuffer . length
485- )
481+ const { uploadUrl, uploadId, kmsKeyArn } = await this . config . proxyClient . createUploadUrl (
482+ this . config . conversationId ,
483+ zipFileChecksum ,
484+ zipFileBuffer . length
485+ )
486486
487- await uploadCode ( uploadUrl , zipFileBuffer , zipFileChecksum , kmsKeyArn )
488- action . messenger . sendAnswer ( {
489- message : i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' ) ,
490- type : 'answer-part' ,
491- tabID : this . tabID ,
492- } )
487+ await uploadCode ( uploadUrl , zipFileBuffer , zipFileChecksum , kmsKeyArn )
488+ action . messenger . sendAnswer ( {
489+ message : i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' ) ,
490+ type : 'answer-part' ,
491+ tabID : this . tabID ,
492+ } )
493493
494- action . messenger . sendUpdatePlaceholder (
495- this . tabID ,
496- i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' )
497- )
494+ action . messenger . sendUpdatePlaceholder (
495+ this . tabID ,
496+ i18n ( 'AWS.amazonq.featureDev.pillText.contextGatheringCompleted' )
497+ )
498+
499+ return uploadId
500+ } )
501+ this . uploadId = uploadId
498502
499- return uploadId
500- } )
501- this . uploadId = uploadId
502- }
503503 const nextState = new CodeGenState (
504504 { ...this . config , uploadId : this . uploadId , currentCodeGenerationId : this . currentCodeGenerationId } ,
505505 this . filePaths ,
0 commit comments