Skip to content

Commit 993e88c

Browse files
authored
Merge branch 'master' into nep-flare
2 parents 30a74b9 + 7b161da commit 993e88c

File tree

111 files changed

+18563
-5138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+18563
-5138
lines changed

package-lock.json

Lines changed: 8568 additions & 4963 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"skippedTestReport": "ts-node ./scripts/skippedTestReport.ts ./packages/amazonq/test/e2e/"
4242
},
4343
"devDependencies": {
44-
"@aws-toolkits/telemetry": "^1.0.324",
44+
"@aws-toolkits/telemetry": "^1.0.326",
4545
"@playwright/browser-chromium": "^1.43.1",
4646
"@stylistic/eslint-plugin": "^2.11.0",
4747
"@types/he": "^1.2.3",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"date": "2025-07-02",
3+
"version": "1.81.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Stop auto inline completion when deleting code"
8+
}
9+
]
10+
}

packages/amazonq/.changes/next-release/Bug Fix-8d48cfa7-278f-4b38-8121-0738bb0841b1.json

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Prompt re-authenticate if auto trigger failed with expired token"
4+
}

packages/amazonq/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.81.0 2025-07-02
2+
3+
- **Bug Fix** Stop auto inline completion when deleting code
4+
15
## 1.80.0 2025-07-01
26

37
- Miscellaneous non-user-facing changes

packages/amazonq/package.json

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "amazon-q-vscode",
33
"displayName": "Amazon Q",
44
"description": "The most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI",
5-
"version": "1.81.0-SNAPSHOT",
5+
"version": "1.82.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],
@@ -1227,110 +1227,124 @@
12271227
"fontCharacter": "\\f1d0"
12281228
}
12291229
},
1230-
"aws-lambda-function": {
1230+
"aws-lambda-create-stack": {
12311231
"description": "AWS Contributed Icon",
12321232
"default": {
12331233
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12341234
"fontCharacter": "\\f1d1"
12351235
}
12361236
},
1237-
"aws-mynah-MynahIconBlack": {
1237+
"aws-lambda-create-stack-light": {
12381238
"description": "AWS Contributed Icon",
12391239
"default": {
12401240
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12411241
"fontCharacter": "\\f1d2"
12421242
}
12431243
},
1244-
"aws-mynah-MynahIconWhite": {
1244+
"aws-lambda-function": {
12451245
"description": "AWS Contributed Icon",
12461246
"default": {
12471247
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12481248
"fontCharacter": "\\f1d3"
12491249
}
12501250
},
1251-
"aws-mynah-logo": {
1251+
"aws-mynah-MynahIconBlack": {
12521252
"description": "AWS Contributed Icon",
12531253
"default": {
12541254
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12551255
"fontCharacter": "\\f1d4"
12561256
}
12571257
},
1258-
"aws-redshift-cluster": {
1258+
"aws-mynah-MynahIconWhite": {
12591259
"description": "AWS Contributed Icon",
12601260
"default": {
12611261
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12621262
"fontCharacter": "\\f1d5"
12631263
}
12641264
},
1265-
"aws-redshift-cluster-connected": {
1265+
"aws-mynah-logo": {
12661266
"description": "AWS Contributed Icon",
12671267
"default": {
12681268
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12691269
"fontCharacter": "\\f1d6"
12701270
}
12711271
},
1272-
"aws-redshift-database": {
1272+
"aws-redshift-cluster": {
12731273
"description": "AWS Contributed Icon",
12741274
"default": {
12751275
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12761276
"fontCharacter": "\\f1d7"
12771277
}
12781278
},
1279-
"aws-redshift-redshift-cluster-connected": {
1279+
"aws-redshift-cluster-connected": {
12801280
"description": "AWS Contributed Icon",
12811281
"default": {
12821282
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12831283
"fontCharacter": "\\f1d8"
12841284
}
12851285
},
1286-
"aws-redshift-schema": {
1286+
"aws-redshift-database": {
12871287
"description": "AWS Contributed Icon",
12881288
"default": {
12891289
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12901290
"fontCharacter": "\\f1d9"
12911291
}
12921292
},
1293-
"aws-redshift-table": {
1293+
"aws-redshift-redshift-cluster-connected": {
12941294
"description": "AWS Contributed Icon",
12951295
"default": {
12961296
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12971297
"fontCharacter": "\\f1da"
12981298
}
12991299
},
1300-
"aws-s3-bucket": {
1300+
"aws-redshift-schema": {
13011301
"description": "AWS Contributed Icon",
13021302
"default": {
13031303
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13041304
"fontCharacter": "\\f1db"
13051305
}
13061306
},
1307-
"aws-s3-create-bucket": {
1307+
"aws-redshift-table": {
13081308
"description": "AWS Contributed Icon",
13091309
"default": {
13101310
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13111311
"fontCharacter": "\\f1dc"
13121312
}
13131313
},
1314-
"aws-schemas-registry": {
1314+
"aws-s3-bucket": {
13151315
"description": "AWS Contributed Icon",
13161316
"default": {
13171317
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13181318
"fontCharacter": "\\f1dd"
13191319
}
13201320
},
1321-
"aws-schemas-schema": {
1321+
"aws-s3-create-bucket": {
13221322
"description": "AWS Contributed Icon",
13231323
"default": {
13241324
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13251325
"fontCharacter": "\\f1de"
13261326
}
13271327
},
1328-
"aws-stepfunctions-preview": {
1328+
"aws-schemas-registry": {
13291329
"description": "AWS Contributed Icon",
13301330
"default": {
13311331
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13321332
"fontCharacter": "\\f1df"
13331333
}
1334+
},
1335+
"aws-schemas-schema": {
1336+
"description": "AWS Contributed Icon",
1337+
"default": {
1338+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1339+
"fontCharacter": "\\f1e0"
1340+
}
1341+
},
1342+
"aws-stepfunctions-preview": {
1343+
"description": "AWS Contributed Icon",
1344+
"default": {
1345+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1346+
"fontCharacter": "\\f1e1"
1347+
}
13341348
}
13351349
},
13361350
"walkthroughs": [

packages/amazonq/src/app/inline/completion.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
324324
position,
325325
context,
326326
token,
327+
isAutoTrigger,
327328
getAllRecommendationsOptions,
328329
editsStreakToken
329330
)

packages/amazonq/src/app/inline/recommendationService.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { CancellationToken, InlineCompletionContext, Position, TextDocument } fr
1212
import { LanguageClient } from 'vscode-languageclient'
1313
import { SessionManager } from './sessionManager'
1414
import { InlineGeneratingMessage } from './inlineGeneratingMessage'
15-
import { CodeWhispererStatusBarManager } from 'aws-core-vscode/codewhisperer'
15+
import { AuthUtil, CodeWhispererStatusBarManager } from 'aws-core-vscode/codewhisperer'
1616
import { TelemetryHelper } from './telemetryHelper'
1717
import { ICursorUpdateRecorder } from './cursorUpdateManager'
1818
import { globals, getLogger } from 'aws-core-vscode/shared'
@@ -28,7 +28,6 @@ export class RecommendationService {
2828
private readonly inlineGeneratingMessage: InlineGeneratingMessage,
2929
private cursorUpdateRecorder?: ICursorUpdateRecorder
3030
) {}
31-
3231
/**
3332
* Set the recommendation service
3433
*/
@@ -42,6 +41,7 @@ export class RecommendationService {
4241
position: Position,
4342
context: InlineCompletionContext,
4443
token: CancellationToken,
44+
isAutoTrigger: boolean,
4545
options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true },
4646
editsStreakToken?: number | string
4747
) {
@@ -143,8 +143,20 @@ export class RecommendationService {
143143
this.sessionManager.closeSession()
144144
TelemetryHelper.instance.setAllPaginationEndTime()
145145
options.emitTelemetry && TelemetryHelper.instance.tryRecordClientComponentLatency()
146-
} catch (error) {
146+
} catch (error: any) {
147147
getLogger().error('Error getting recommendations: %O', error)
148+
// bearer token expired
149+
if (error.data && error.data.awsErrorCode === 'E_AMAZON_Q_CONNECTION_EXPIRED') {
150+
// ref: https://github.com/aws/aws-toolkit-vscode/blob/amazonq/v1.74.0/packages/core/src/codewhisperer/service/inlineCompletionService.ts#L104
151+
// show re-auth once if connection expired
152+
if (AuthUtil.instance.isConnectionExpired()) {
153+
await AuthUtil.instance.notifyReauthenticate(isAutoTrigger)
154+
} else {
155+
// get a new bearer token, if this failed, the connection will be marked as expired.
156+
// new tokens will be synced per 10 seconds in auth.startTokenRefreshInterval
157+
await AuthUtil.instance.getBearerToken()
158+
}
159+
}
148160
return []
149161
} finally {
150162
// Remove all UI indicators if UI is enabled

packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,14 @@ describe('RecommendationService', () => {
138138

139139
sendRequestStub.resolves(mockFirstResult)
140140

141-
await service.getAllRecommendations(languageClient, mockDocument, mockPosition, mockContext, mockToken)
141+
await service.getAllRecommendations(
142+
languageClient,
143+
mockDocument,
144+
mockPosition,
145+
mockContext,
146+
mockToken,
147+
true
148+
)
142149

143150
// Verify sendRequest was called with correct parameters
144151
assert(sendRequestStub.calledOnce)
@@ -172,7 +179,14 @@ describe('RecommendationService', () => {
172179
sendRequestStub.onFirstCall().resolves(mockFirstResult)
173180
sendRequestStub.onSecondCall().resolves(mockSecondResult)
174181

175-
await service.getAllRecommendations(languageClient, mockDocument, mockPosition, mockContext, mockToken)
182+
await service.getAllRecommendations(
183+
languageClient,
184+
mockDocument,
185+
mockPosition,
186+
mockContext,
187+
mockToken,
188+
true
189+
)
176190

177191
// Verify sendRequest was called with correct parameters
178192
assert(sendRequestStub.calledTwice)
@@ -204,7 +218,14 @@ describe('RecommendationService', () => {
204218

205219
sendRequestStub.resolves(mockFirstResult)
206220

207-
await service.getAllRecommendations(languageClient, mockDocument, mockPosition, mockContext, mockToken)
221+
await service.getAllRecommendations(
222+
languageClient,
223+
mockDocument,
224+
mockPosition,
225+
mockContext,
226+
mockToken,
227+
true
228+
)
208229

209230
// Verify recordCompletionRequest was called
210231
// eslint-disable-next-line @typescript-eslint/unbound-method
@@ -232,10 +253,18 @@ describe('RecommendationService', () => {
232253
const { showGeneratingStub, hideGeneratingStub } = setupUITest()
233254

234255
// Call with showUi: false option
235-
await service.getAllRecommendations(languageClient, mockDocument, mockPosition, mockContext, mockToken, {
236-
showUi: false,
237-
emitTelemetry: true,
238-
})
256+
await service.getAllRecommendations(
257+
languageClient,
258+
mockDocument,
259+
mockPosition,
260+
mockContext,
261+
mockToken,
262+
true,
263+
{
264+
showUi: false,
265+
emitTelemetry: true,
266+
}
267+
)
239268

240269
// Verify UI methods were not called
241270
sinon.assert.notCalled(showGeneratingStub)
@@ -248,7 +277,14 @@ describe('RecommendationService', () => {
248277
const { showGeneratingStub, hideGeneratingStub } = setupUITest()
249278

250279
// Call with default options (showUi: true)
251-
await service.getAllRecommendations(languageClient, mockDocument, mockPosition, mockContext, mockToken)
280+
await service.getAllRecommendations(
281+
languageClient,
282+
mockDocument,
283+
mockPosition,
284+
mockContext,
285+
mockToken,
286+
true
287+
)
252288

253289
// Verify UI methods were called
254290
sinon.assert.calledOnce(showGeneratingStub)
@@ -284,6 +320,7 @@ describe('RecommendationService', () => {
284320
mockPosition,
285321
mockContext,
286322
mockToken,
323+
true,
287324
options
288325
)
289326

0 commit comments

Comments
 (0)