Skip to content

Commit

Permalink
Edit: Remove ghost hint feature flag (#3492)
Browse files Browse the repository at this point in the history
  • Loading branch information
umpox authored Mar 21, 2024
1 parent 4201825 commit 1cd1e09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
3 changes: 0 additions & 3 deletions lib/shared/src/experimentation/FeatureFlagProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ export enum FeatureFlag {
// When enabled, fuses embeddings and symf context for chat.
CodyChatFusedContext = 'cody-chat-fused-context',

// Show command hints alongside editor selections. "Opt+K to Edit, Opt+L to Chat"
CodyCommandHints = 'cody-command-hints',

// Show document hints above a symbol if the users' cursor is there. "Opt+D to Document"
CodyDocumentHints = 'cody-document-hints',

Expand Down
26 changes: 6 additions & 20 deletions vscode/src/commands/GhostHintDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ export async function getGhostHintEnablement(): Promise<EnabledFeatures> {

// Return the actual configuration setting, if set. Otherwise return the default value from the feature flag.
return {
EditOrChat:
settingValue ??
(await featureFlagProvider.evaluateFeatureFlag(FeatureFlag.CodyCommandHints)),
/**
* We're not running an A/B test on the "Opt+K to Text".
* We can safely set the default of this to `true`.
*/
EditOrChat: settingValue ?? true,
Document:
settingValue ??
(await featureFlagProvider.evaluateFeatureFlag(FeatureFlag.CodyDocumentHints)),
Expand Down Expand Up @@ -177,8 +179,7 @@ export class GhostHintDecorator implements vscode.Disposable {
* Tracks whether the user has recorded an enrollment for each ghost variant.
* This is _only_ to help us measure usage via an A/B test.
*/
private enrollmentRecorded: Record<Exclude<GhostVariant, 'Generate'>, boolean> = {
EditOrChat: false,
private enrollmentRecorded: Record<Exclude<GhostVariant, 'Generate' | 'EditOrChat'>, boolean> = {
Document: false,
}

Expand Down Expand Up @@ -434,21 +435,6 @@ export class GhostHintDecorator implements vscode.Disposable {
// We do not need to repeatedly mark the users' enrollment.
this.enrollmentRecorded.Document = true
}

if (variant === 'EditOrChat' && !this.enrollmentRecorded.EditOrChat) {
const testGroup = enablement.EditOrChat ? 'treatment' : 'control'
telemetryService.log(
'CodyVSCodeExtension:experiment:ghostText:enrolled',
{ variant: testGroup },
{ hasV2Event: true }
)
telemetryRecorder.recordEvent('cody.experiment.ghostText', 'enrolled', {
privateMetadata: { variant: testGroup },
})
// Mark this enrollment as recorded for the current session
// We do not need to repeatedly mark the users' enrollment.
this.enrollmentRecorded.EditOrChat = true
}
}

private async updateEnablement(authStatus: AuthStatus): Promise<void> {
Expand Down

0 comments on commit 1cd1e09

Please sign in to comment.