Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion packages/amazonq/src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import {
AuthUtil,
CodeWhispererSettings,
FeatureConfigProvider,
getSelectedCustomization,
TelemetryHelper,
vsCodeState,
Expand Down Expand Up @@ -339,12 +340,14 @@ async function onLanguageServerReady(
// tutorial for inline chat
const inlineChatTutorialAnnotation = new InlineChatTutorialAnnotation(inlineTutorialAnnotation)

const enableInlineRollback = true
const enableInlineRollback = FeatureConfigProvider.instance.getPreFlareRollbackGroup() === 'treatment'
Copy link
Contributor

@leigaol leigaol Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when this line of code is invoked at the activation phrase, the feature config API has not been called and it won't know if it is treatment or not.

Can you do this:

  1. In the FeatureConfig provider, when it call getPreFlareRollbackGroup. If there is API response, if this response is not the same as disk cache, override disk cache. If the response is the same as disk cache. do nothing. If this getPreFlareRollbackGroup is called even before the listFeatureEvaluation API call, then just return from the cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I setup debug mode and it was called before this line, let me double check again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025-09-08 18:51:01.940 [info] AB Testing Cohort Assignments [
  {
    feature: 'PreflareRollbackExperiment_BID',
    variation: 'CONTROL',
    value: { stringValue: 'CONTROL' }
  }
]
2025-09-08 18:51:01.940 [debug] CodeWhisperer: Current feature configs: {PreflareRollbackExperiment_BID: CONTROL}
2025-09-08 18:51:03.182 [info] Command: (not started) [/Users/yuxqiang/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.31.0/servers/node --inspect=6080 --max-old-space-size=8196 /Users/yuxqiang/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.31.0/servers/aws-lsp-codewhisperer.js --nolazy --preserve-symlinks --stdio --pre-init-encryption --set-credentials-encryption-key] (running processes: 1)
2025-09-08 18:51:04.014 [debug] amazonqLsp: Fetching config section aws.q for language server
2025-09-08 18:51:04.014 [debug] amazonqLsp: Fetching config section aws.q for language server
2025-09-08 18:51:04.380 [debug] codewhisperer: new user login, activating inline tutorial. (autotriggerEnabled=true; inlineState=amazonq_annotation_inline_chat)
2025-09-08 18:51:04.380 [info] Entering postflare logic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also:

// This contains every lsp agnostic things (auth, security scan, code scan)
    await activateCodeWhisperer(extContext as ExtContext)

    if (!isAmazonLinux2() || hasGlibcPatch()) {
        // Activate Amazon Q LSP for everyone unless they're using AL2 without the glibc patch
        await activateAmazonqLsp(context)
    }

activateCodeWhisperer will call fetchFeatureConfig once at the end, activateAmazonqLsp will deterine whether it goes the preflare or post flare path.

if (enableInlineRollback) {
// use VSC inline
getLogger().info('Entering preflare logic')
await activateInline(client)
} else {
// use language server for inline completion
getLogger().info('Entering postflare logic')
const inlineManager = new InlineCompletionManager(client, sessionManager, lineTracker, inlineTutorialAnnotation)
inlineManager.registerInlineCompletion()
toDispose.push(
Expand Down
12 changes: 12 additions & 0 deletions packages/core/src/shared/featureConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export const Features = {
dataCollectionFeature: 'IDEProjectContextDataCollection',
projectContextFeature: 'ProjectContextV2',
workspaceContextFeature: 'WorkspaceContext',
preFlareRollbackBIDFeature: 'PreflareRollbackExperiment_BID',
preFlareRollbackIDCFeature: 'PreflareRollbackExperiment_IDC',
test: 'testFeature',
highlightCommand: 'highlightCommand',
} as const
Expand Down Expand Up @@ -106,6 +108,16 @@ export class FeatureConfigProvider {
}
}

getPreFlareRollbackGroup(): 'control' | 'treatment' | 'default' {
const variationBid = this.featureConfigs.get(Features.preFlareRollbackBIDFeature)?.variation
const variationIdc = this.featureConfigs.get(Features.preFlareRollbackIDCFeature)?.variation
if (variationBid === 'TREATMENT' || variationIdc === 'TREATMENT') {
return 'treatment'
} else {
return 'control'
}
}

public async listFeatureEvaluations(): Promise<ListFeatureEvaluationsResponse> {
const profile = AuthUtil.instance.regionProfileManager.activeRegionProfile
const request: ListFeatureEvaluationsRequest = {
Expand Down
Loading