Skip to content

Commit

Permalink
Autocomplete: cleanup the fast-path a/b test (#6039)
Browse files Browse the repository at this point in the history
- We
[finished](https://sourcegraph.slack.com/archives/C0729T2PBV2/p1730167483283679?thread_ts=1728366545.242119&cid=C0729T2PBV2)
the fast-path A/B test, so this PR removes all related logic.
  • Loading branch information
valerybugakov authored Nov 1, 2024
1 parent dd821c7 commit d241897
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
1 change: 0 additions & 1 deletion vscode/src/completions/completion-provider-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class CompletionProviderConfig {
FeatureFlag.CodyAutocompletePreloadingExperimentVariant2,
FeatureFlag.CodyAutocompleteDataCollectionFlag,
FeatureFlag.CodyAutocompleteTracing,
FeatureFlag.CodyAutocompleteFastPath,
]
this.prefetchSubscription = combineLatest(
...featureFlagsUsed.map(flag => featureFlagProvider.evaluatedFeatureFlag(flag))
Expand Down
31 changes: 1 addition & 30 deletions vscode/src/completions/providers/fireworks.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import type * as vscode from 'vscode'

import {
type AuthenticatedAuthStatus,
type CodeCompletionsParams,
type CompletionResponseGenerator,
FeatureFlag,
currentAuthStatusAuthed,
currentResolvedConfig,
dotcomTokenToGatewayToken,
featureFlagProvider,
isDotCom,
isDotComAuthed,
subscriptionDisposable,
tokensToChars,
} from '@sourcegraph/cody-shared'

Expand All @@ -24,7 +19,6 @@ import {
MAX_RESPONSE_TOKENS,
Provider,
type ProviderFactoryParams,
type ProviderOptions,
} from './shared/provider'

export const DEEPSEEK_CODER_V2_LITE_BASE = 'deepseek-coder-v2-lite-base'
Expand Down Expand Up @@ -90,22 +84,6 @@ function getMaxContextTokens(model: FireworksModel): number {
}

class FireworksProvider extends Provider {
private disposables: vscode.Disposable[] = []
private isFastPathEnabled = true

constructor(public readonly options: Readonly<ProviderOptions>) {
super(options)

this.disposables.push(
subscriptionDisposable(
featureFlagProvider
.evaluatedFeatureFlag(FeatureFlag.CodyAutocompleteFastPath)
.subscribe(isFastPathEnabled => {
this.isFastPathEnabled = Boolean(isFastPathEnabled)
})
)
)
}
public getRequestParams(options: GenerateCompletionsOptions): CodeCompletionsParams {
const { multiline, docContext, document, triggerKind, snippets } = options
const useMultilineModel = multiline || triggerKind !== TriggerKind.Automatic
Expand Down Expand Up @@ -162,7 +140,7 @@ class FireworksProvider extends Provider {
? config.configuration.autocompleteExperimentalFireworksOptions?.token
: undefined

if ((fastPathAccessToken && this.isFastPathEnabled) || localFastPathAccessToken) {
if (fastPathAccessToken || localFastPathAccessToken) {
return createFastPathClient(requestParams, abortController, {
isLocalInstance,
fireworksConfig: localFastPathAccessToken
Expand Down Expand Up @@ -192,13 +170,6 @@ class FireworksProvider extends Provider {

return customHeaders
}

public dispose(): void {
for (const disposable of this.disposables) {
disposable.dispose()
}
this.disposables = []
}
}

function getClientModel(
Expand Down

0 comments on commit d241897

Please sign in to comment.