Skip to content

Commit 5bfde04

Browse files
committed
fix(amazonqFeatureDev): include currentCodeGenerationId to track reference for stop code generation
1 parent b99f4db commit 5bfde04

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

packages/core/src/amazonqFeatureDev/session/session.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export class Session {
109109
workspaceFolders: this.config.workspaceFolders,
110110
proxyClient: this.proxyClient,
111111
conversationId: this.conversationId,
112-
currentCodeGenerationId: this.currentCodeGenerationId as string,
113112
}
114113
}
115114

packages/core/src/amazonqFeatureDev/session/sessionState.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ export class CodeGenState extends CodeGenBase implements SessionState {
306306
this.tokenSource = action.tokenSource
307307
}
308308
this.isCancellationRequested = true
309+
if (action.tokenSource) {
310+
this.tokenSource = action.tokenSource
311+
}
309312
action.tokenSource?.dispose()
310313
action.tokenSource = undefined
311314
})
@@ -321,6 +324,9 @@ export class CodeGenState extends CodeGenBase implements SessionState {
321324
this.currentCodeGenerationId
322325
)
323326

327+
this.currentCodeGenerationId = codeGenerationId
328+
this.config.currentCodeGenerationId = codeGenerationId
329+
324330
if (!this.isCancellationRequested) {
325331
action.messenger.sendAnswer({
326332
message: i18n('AWS.amazonq.featureDev.pillText.generatingCode'),
@@ -373,10 +379,10 @@ export class CodeGenState extends CodeGenBase implements SessionState {
373379
this.currentIteration + 1,
374380
this.codeGenerationRemainingIterationCount,
375381
this.codeGenerationTotalIterationCount,
376-
this.currentCodeGenerationId,
377382
action.uploadHistory,
378383
codeGenerationId,
379-
this.tokenSource
384+
this.tokenSource,
385+
this.currentCodeGenerationId
380386
)
381387
return {
382388
nextState,
@@ -498,10 +504,10 @@ export class PrepareCodeGenState implements SessionState {
498504
public currentIteration: number,
499505
public codeGenerationRemainingIterationCount?: number,
500506
public codeGenerationTotalIterationCount?: number,
501-
public currentCodeGenerationId?: string,
502507
public uploadHistory: UploadHistory = {},
503508
public codeGenerationId?: string,
504-
public superTokenSource?: vscode.CancellationTokenSource
509+
public superTokenSource?: vscode.CancellationTokenSource,
510+
public currentCodeGenerationId?: string
505511
) {
506512
this.tokenSource = superTokenSource || new vscode.CancellationTokenSource()
507513
this.uploadId = config.uploadId

0 commit comments

Comments
 (0)