Skip to content

Commit 12e1376

Browse files
committed
fix(amazonqFeatureDev): create a new token to stop and iterate in the same session
1 parent 14a620a commit 12e1376

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,17 @@ export class Session {
137137

138138
if (resp.nextState) {
139139
// Cancel the request before moving to a new state
140+
<<<<<<< HEAD
140141
<<<<<<< HEAD
141142
if (!this.state?.tokenSource?.token.isCancellationRequested) {
142143
this.state?.tokenSource?.cancel()
143144
}
144145
=======
145146
this.state?.tokenSource?.cancel()
146147
>>>>>>> 4742b3c59 (refactor(amazonqFeatureDev): include updated rts model)
148+
=======
149+
if (!this.state?.tokenSource?.token.isCancellationRequested) this.state?.tokenSource?.cancel()
150+
>>>>>>> e6782b66f (fix(amazonqFeatureDev): create a new token to stop and iterate in the same session)
147151

148152
// Move to the next state
149153
this._state = resp.nextState

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,6 @@ 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-
}
312309
action.tokenSource?.dispose()
313310
action.tokenSource = undefined
314311
})
@@ -324,9 +321,6 @@ export class CodeGenState extends CodeGenBase implements SessionState {
324321
this.currentCodeGenerationId
325322
)
326323

327-
this.currentCodeGenerationId = codeGenerationId
328-
this.config.currentCodeGenerationId = codeGenerationId
329-
330324
if (!this.isCancellationRequested) {
331325
action.messenger.sendAnswer({
332326
message: i18n('AWS.amazonq.featureDev.pillText.generatingCode'),
@@ -541,7 +535,11 @@ export class PrepareCodeGenState implements SessionState {
541535
span
542536
)
543537
const uploadId = randomUUID()
544-
const { uploadUrl, kmsKeyArn } = await this.config.proxyClient.createUploadUrl(
538+
const {
539+
uploadUrl,
540+
uploadId: returnedUploadId,
541+
kmsKeyArn,
542+
} = await this.config.proxyClient.createUploadUrl(
545543
this.config.conversationId,
546544
zipFileChecksum,
547545
zipFileBuffer.length,

0 commit comments

Comments
 (0)