Skip to content

Merge master into feature/flare-inline #7299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9f44fa6
Release 3.60.0
May 6, 2025
734bd98
fix(nep): truncate editor state (#7256)
tomcat323 May 8, 2025
529f833
fix(amazonq): Revert refactor(amazonq): reduce extra call of listAvai…
Will-ShaoHua May 8, 2025
8a02d60
fix(amazonq): agent tabs open with prompt options (#7265)
ctlai95 May 8, 2025
4369fb5
fix(amazonq): flare clientId changes on every instance (#7273)
jpinkney-aws May 9, 2025
0d97988
Release 1.66.0
May 9, 2025
dcaeb53
Update version to snapshot version: 3.61.0-SNAPSHOT
May 9, 2025
3290630
Merge release into master
May 9, 2025
91e5039
Update version to snapshot version: 1.67.0-SNAPSHOT
May 9, 2025
a7fd043
Merge release into master
May 9, 2025
1085a8d
telemetry(amazonq): Emit metric on server crash (#7278)
nkomonen-amazon May 9, 2025
a14b9a2
telemetry(amazonq): expose FileCreationFailed exceptions #7260
akhamis-amzn May 9, 2025
05cde57
fix(lsp): send extension version to Q LSP #7279
yueny2020 May 9, 2025
4b09167
fix(amazonq): adding logs for the agentic chat telemetry events (#7276)
laileni-aws May 9, 2025
ffc0cb4
fix(amazonq): pass uri.path as workspaceIdentifier when initializing …
LiGaCu May 12, 2025
2d898fb
deps: bump @aws-toolkits/telemetry to 1.0.318 #7290
avi-alpert May 12, 2025
8e85476
fix(amazonq): use neighbor cells as completion context in Notebook #7086
brdskggs May 13, 2025
c97740e
feat(amazonq): import userWrittenCode configuration for inline with l…
zixlin7 May 13, 2025
143e35c
fix(amazonq): push customizations on startup (#7297)
nkomonen-amazon May 13, 2025
3f5fa17
deps: bump @aws-toolkits/telemetry to 1.0.319 (#7300)
chungjac May 14, 2025
6081f89
fix(amazonq):support chat in al2 aarch64 and CDM (#7270)
leigaol May 14, 2025
e47ff14
Merge remote-tracking branch 'origin/master' into HEAD
Hweinstock May 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"skippedTestReport": "ts-node ./scripts/skippedTestReport.ts ./packages/amazonq/test/e2e/"
},
"devDependencies": {
"@aws-toolkits/telemetry": "^1.0.318",
"@aws-toolkits/telemetry": "^1.0.319",
"@playwright/browser-chromium": "^1.43.1",
"@stylistic/eslint-plugin": "^2.11.0",
"@types/he": "^1.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Support chat in AL2 aarch64"
}
4 changes: 2 additions & 2 deletions packages/amazonq/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
maybeShowMinVscodeWarning,
Experiments,
isSageMaker,
isAmazonInternalOs,
isAmazonLinux2,
} from 'aws-core-vscode/shared'
import { ExtStartUpSources } from 'aws-core-vscode/telemetry'
import { VSCODE_EXTENSION_ID } from 'aws-core-vscode/utils'
Expand Down Expand Up @@ -123,7 +123,7 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
await activateCodeWhisperer(extContext as ExtContext)
if (
(Experiments.instance.get('amazonqLSP', true) || Auth.instance.isInternalAmazonUser()) &&
(!isAmazonInternalOs() || (await hasGlibcPatch()))
(!isAmazonLinux2() || hasGlibcPatch())
) {
// start the Amazon Q LSP for internal users first
// for AL2, start LSP if glibc patch is found
Expand Down
5 changes: 5 additions & 0 deletions packages/amazonq/src/lsp/chat/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export async function activate(languageClient: LanguageClient, encryptionKey: Bu
type: 'profile',
profileArn: AuthUtil.instance.regionProfileManager.activeRegionProfile?.arn,
})
// We need to push the cached customization on startup explicitly
await pushConfigUpdate(languageClient, {
type: 'customization',
customization: getSelectedCustomization(),
})

const provider = new AmazonQChatViewProvider(mynahUIPath)

Expand Down
21 changes: 10 additions & 11 deletions packages/amazonq/src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ import {
getLogger,
undefinedIfEmpty,
getOptOutPreference,
isAmazonInternalOs,
fs,
isAmazonLinux2,
getClientId,
extensionVersion,
} from 'aws-core-vscode/shared'
Expand All @@ -55,8 +54,11 @@ import { InlineChatTutorialAnnotation } from '../app/inline/tutorials/inlineChat
const localize = nls.loadMessageBundle()
const logger = getLogger('amazonqLsp.lspClient')

export async function hasGlibcPatch(): Promise<boolean> {
return await fs.exists('/opt/vsc-sysroot/lib64/ld-linux-x86-64.so.2')
export const glibcLinker: string = process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER || ''
export const glibcPath: string = process.env.VSCODE_SERVER_CUSTOM_GLIBC_PATH || ''

export function hasGlibcPatch(): boolean {
return glibcLinker.length > 0 && glibcPath.length > 0
}

export async function startLanguageServer(
Expand All @@ -81,13 +83,8 @@ export async function startLanguageServer(
const traceServerEnabled = Settings.instance.isSet(`${clientId}.trace.server`)
let executable: string[] = []
// apply the GLIBC 2.28 path to node js runtime binary
if (isAmazonInternalOs() && (await hasGlibcPatch())) {
executable = [
'/opt/vsc-sysroot/lib64/ld-linux-x86-64.so.2',
'--library-path',
'/opt/vsc-sysroot/lib64',
resourcePaths.node,
]
if (isAmazonLinux2() && hasGlibcPatch()) {
executable = [glibcLinker, '--library-path', glibcPath, resourcePaths.node]
getLogger('amazonqLsp').info(`Patched node runtime with GLIBC to ${executable}`)
} else {
executable = [resourcePaths.node]
Expand Down Expand Up @@ -380,6 +377,8 @@ function getConfigSection(section: ConfigSection) {
includeSuggestionsWithCodeReferences:
CodeWhispererSettings.instance.isSuggestionsWithCodeReferencesEnabled(),
shareCodeWhispererContentWithAWS: !CodeWhispererSettings.instance.isOptoutEnabled(),
includeImportsWithSuggestions: CodeWhispererSettings.instance.isImportRecommendationEnabled(),
sendUserWrittenCodeMetrics: true,
},
]
case 'aws.logLevel':
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export * from './extensionUtilities'
export * from './extensionStartup'
export { RegionProvider } from './regions/regionProvider'
export { Commands } from './vscode/commands2'
export { getMachineId, getServiceEnvVarConfig, isAmazonInternalOs } from './vscode/env'
export { getMachineId, getServiceEnvVarConfig, isAmazonLinux2 } from './vscode/env'
export { getLogger } from './logger/logger'
export { activateExtension, openUrl } from './utilities/vsCodeUtils'
export { waitUntil, sleep, Timeout } from './utilities/timeoutUtils'
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/shared/telemetry/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
isAutomation,
isRemoteWorkspace,
isCloudDesktop,
isAmazonInternalOs,
isAmazonLinux2,
} from '../vscode/env'
import { addTypeName } from '../utilities/typeConstructors'
import globals, { isWeb } from '../extensionGlobals'
Expand Down Expand Up @@ -290,7 +290,7 @@ export async function getComputeEnvType(): Promise<EnvType> {
} else if (isSageMaker()) {
return web ? 'sagemaker-web' : 'sagemaker'
} else if (isRemoteWorkspace()) {
if (isAmazonInternalOs()) {
if (isAmazonLinux2()) {
if (await isCloudDesktop()) {
return 'cloudDesktop-amzn'
}
Expand Down
14 changes: 6 additions & 8 deletions packages/core/src/shared/vscode/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,21 @@ export function isRemoteWorkspace(): boolean {
}

/**
* There is Amazon Linux 2, but additionally an Amazon Linux 2 Internal.
* The internal version is for Amazon employees only. And this version can
* be used by either EC2 OR CloudDesktop. It is not exclusive to either.
* There is Amazon Linux 2.
*
* Use {@link isCloudDesktop()} to know if we are specifically using it.
* Use {@link isCloudDesktop()} to know if we are specifically using internal Amazon Linux 2.
*
* Example: `5.10.220-188.869.amzn2int.x86_64`
* Example: `5.10.220-188.869.amzn2int.x86_64` or `5.10.236-227.928.amzn2.x86_64` (Cloud Dev Machine)
*/
export function isAmazonInternalOs() {
return os.release().includes('amzn2int') && process.platform === 'linux'
export function isAmazonLinux2() {
return (os.release().includes('.amzn2int.') || os.release().includes('.amzn2.')) && process.platform === 'linux'
}

/**
* Returns true if we are in an internal Amazon Cloud Desktop
*/
export async function isCloudDesktop() {
if (!isAmazonInternalOs()) {
if (!isAmazonLinux2()) {
return false
}

Expand Down
17 changes: 7 additions & 10 deletions packages/core/src/test/shared/vscode/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

import assert from 'assert'
import path from 'path'
import {
isCloudDesktop,
getEnvVars,
getServiceEnvVarConfig,
isAmazonInternalOs as isAmazonInternalOS,
isBeta,
} from '../../../shared/vscode/env'
import { isCloudDesktop, getEnvVars, getServiceEnvVarConfig, isAmazonLinux2, isBeta } from '../../../shared/vscode/env'
import { ChildProcess } from '../../../shared/utilities/processUtils'
import * as sinon from 'sinon'
import os from 'os'
Expand Down Expand Up @@ -103,13 +97,16 @@ describe('env', function () {
assert.strictEqual(isBeta(), expected)
})

it('isAmazonInternalOS', function () {
it('isAmazonLinux2', function () {
sandbox.stub(process, 'platform').value('linux')
const versionStub = stubOsVersion('5.10.220-188.869.amzn2int.x86_64')
assert.strictEqual(isAmazonInternalOS(), true)
assert.strictEqual(isAmazonLinux2(), true)

versionStub.returns('5.10.236-227.928.amzn2.x86_64')
assert.strictEqual(isAmazonLinux2(), true)

versionStub.returns('5.10.220-188.869.NOT_INTERNAL.x86_64')
assert.strictEqual(isAmazonInternalOS(), false)
assert.strictEqual(isAmazonLinux2(), false)
})

it('isCloudDesktop', async function () {
Expand Down