Skip to content

Commit b99f4db

Browse files
committed
refactor(amazonqFeatureDev): include updated rts model
1 parent d70bb9e commit b99f4db

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

packages/core/src/amazonqFeatureDev/client/featureDev.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ export class FeatureDevClient {
134134
conversationId: string,
135135
uploadId: string,
136136
message: string,
137+
<<<<<<< HEAD
137138
codeGenerationId: string,
139+
=======
140+
>>>>>>> 4742b3c59 (refactor(amazonqFeatureDev): include updated rts model)
138141
currentCodeGenerationId?: string
139142
) {
140143
try {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export class Session {
109109
workspaceFolders: this.config.workspaceFolders,
110110
proxyClient: this.proxyClient,
111111
conversationId: this.conversationId,
112+
currentCodeGenerationId: this.currentCodeGenerationId as string,
112113
}
113114
}
114115

@@ -137,9 +138,13 @@ export class Session {
137138

138139
if (resp.nextState) {
139140
// Cancel the request before moving to a new state
141+
<<<<<<< HEAD
140142
if (!this.state?.tokenSource?.token.isCancellationRequested) {
141143
this.state?.tokenSource?.cancel()
142144
}
145+
=======
146+
this.state?.tokenSource?.cancel()
147+
>>>>>>> 4742b3c59 (refactor(amazonqFeatureDev): include updated rts model)
143148

144149
// Move to the next state
145150
this._state = resp.nextState

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ abstract class CodeGenBase {
147147
public tabID: string
148148
) {
149149
this.tokenSource = new vscode.CancellationTokenSource()
150+
this.isCancellationRequested = false
150151
this.conversationId = config.conversationId
151152
this.uploadId = config.uploadId
152153
this.currentCodeGenerationId = config.currentCodeGenerationId || EmptyCodeGenID
@@ -304,6 +305,9 @@ export class CodeGenState extends CodeGenBase implements SessionState {
304305
if (action.tokenSource) {
305306
this.tokenSource = action.tokenSource
306307
}
308+
this.isCancellationRequested = true
309+
action.tokenSource?.dispose()
310+
action.tokenSource = undefined
307311
})
308312

309313
action.telemetry.setGenerateCodeIteration(this.currentIteration)
@@ -492,7 +496,6 @@ export class PrepareCodeGenState implements SessionState {
492496
public references: CodeReference[],
493497
public tabID: string,
494498
public currentIteration: number,
495-
496499
public codeGenerationRemainingIterationCount?: number,
497500
public codeGenerationTotalIterationCount?: number,
498501
public currentCodeGenerationId?: string,

0 commit comments

Comments
 (0)