diff --git a/lib/shared/src/experimentation/FeatureFlagProvider.ts b/lib/shared/src/experimentation/FeatureFlagProvider.ts index dc98470dd0bb..d6fc64127994 100644 --- a/lib/shared/src/experimentation/FeatureFlagProvider.ts +++ b/lib/shared/src/experimentation/FeatureFlagProvider.ts @@ -35,7 +35,7 @@ export enum FeatureFlag { CodyAutocompleteDeepseekV2LiteBase = 'cody-autocomplete-deepseek-v2-lite-base', // Data collection variants used for completions and next edit completions - CodyAutocompleteDataCollectionFlag = 'cody-autocomplete-data-collection-flag', + CodyAutocompleteDataCollectionFlag = 'cody-autocomplete-logs-collection-flag', // Enable various feature flags to experiment with FIM trained fine-tuned models via Fireworks CodyAutocompleteFIMModelExperimentBaseFeatureFlag = 'cody-autocomplete-fim-model-experiment-flag', diff --git a/vscode/src/completions/inline-completion-item-provider.ts b/vscode/src/completions/inline-completion-item-provider.ts index b0bdd8297e69..def32c292900 100644 --- a/vscode/src/completions/inline-completion-item-provider.ts +++ b/vscode/src/completions/inline-completion-item-provider.ts @@ -843,7 +843,7 @@ export class InlineCompletionItemProvider takeSuggestWidgetSelectionIntoAccount, undefined ) - completion.requestParams.docContext.position + if (isStillVisible) { suggestionEvent.markAsRead({ document: invokedDocument, diff --git a/vscode/src/completions/providers/fireworks.ts b/vscode/src/completions/providers/fireworks.ts index eb4a00b6abb3..8f7d5579fd13 100644 --- a/vscode/src/completions/providers/fireworks.ts +++ b/vscode/src/completions/providers/fireworks.ts @@ -22,6 +22,9 @@ import { export const DEEPSEEK_CODER_V2_LITE_BASE = 'deepseek-coder-v2-lite-base' // Context window experiments with DeepSeek Model export const DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096 = 'deepseek-coder-v2-lite-base-context-4096' +export const DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192 = 'deepseek-coder-v2-lite-base-context-8192' +export const DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384 = 'deepseek-coder-v2-lite-base-context-16384' + export const CODE_QWEN_7B_V2P5 = 'code-qwen-7b-v2p5' // Model identifiers can be found in https://docs.fireworks.ai/explore/ and in our internal @@ -36,6 +39,8 @@ const MODEL_MAP = { 'llama-code-13b': 'fireworks/accounts/fireworks/models/llama-v2-13b-code', [DEEPSEEK_CODER_V2_LITE_BASE]: 'fireworks/deepseek-coder-v2-lite-base', [DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096]: 'accounts/fireworks/models/deepseek-coder-v2-lite-base', + [DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192]: 'accounts/fireworks/models/deepseek-coder-v2-lite-base', + [DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384]: 'accounts/fireworks/models/deepseek-coder-v2-lite-base', [CODE_QWEN_7B_V2P5]: 'accounts/fireworks/models/qwen-v2p5-7b', } as const @@ -64,6 +69,10 @@ function getMaxContextTokens(model: FireworksModel): number { } case DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096: return 4096 + case DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192: + return 8192 + case DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384: + return 16384 default: return 1200 } diff --git a/vscode/src/completions/providers/shared/get-experiment-model.ts b/vscode/src/completions/providers/shared/get-experiment-model.ts index db5bd462f442..068df34fb80b 100644 --- a/vscode/src/completions/providers/shared/get-experiment-model.ts +++ b/vscode/src/completions/providers/shared/get-experiment-model.ts @@ -14,6 +14,8 @@ import { CODE_QWEN_7B_V2P5, DEEPSEEK_CODER_V2_LITE_BASE, DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096, + DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192, + DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384, } from '../fireworks' interface ProviderConfigFromFeatureFlags { @@ -86,22 +88,38 @@ function resolveFIMModelExperimentFromFeatureFlags(): ReturnType { - if (fimModelVariant1) { - return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096 } - } - if (fimModelVariant2) { - return { provider: 'fireworks', model: CODE_QWEN_7B_V2P5 } - } - if (fimModelControl) { - // Current production model + map( + ([ + fimModelControl, + fimModelVariant1, + fimModelVariant2, + fimModelVariant3, + fimModelVariant4, + ]) => { + if (fimModelVariant1) { + return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096 } + } + if (fimModelVariant2) { + return { provider: 'fireworks', model: CODE_QWEN_7B_V2P5 } + } + if (fimModelVariant3) { + return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192 } + } + if (fimModelVariant4) { + return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384 } + } + if (fimModelControl) { + // Current production model + return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE } + } + // Extra free traffic - redirect to the current production model which could be different than control return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE } } - // Extra free traffic - redirect to the current production model which could be different than control - return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE } - }), + ), distinctUntilChanged() ) } diff --git a/vscode/src/repository/githubRepoMetadata.ts b/vscode/src/repository/githubRepoMetadata.ts index 4e354cf4d00e..9f680ec7adf1 100644 --- a/vscode/src/repository/githubRepoMetadata.ts +++ b/vscode/src/repository/githubRepoMetadata.ts @@ -10,7 +10,6 @@ import { } from '@sourcegraph/cody-shared' import { Observable, map } from 'observable-fns' import { logDebug } from '../log' -import { localStorage } from '../services/LocalStorageProvider' import { remoteReposForAllWorkspaceFolders } from './remoteRepos' interface GitHubDotComRepoMetaData { @@ -22,6 +21,7 @@ interface GitHubDotComRepoMetaData { export class GitHubDotComRepoMetadata { // This class is used to get the metadata from the gitApi. private static instance: GitHubDotComRepoMetadata | null = null + private cache = new Map() private constructor() {} @@ -37,14 +37,7 @@ export class GitHubDotComRepoMetadata { if (!normalizedRepoName) { return undefined } - const repoVisibility = localStorage.getGitHubRepoVisibility(normalizedRepoName) - if (!repoVisibility) { - return undefined - } - return { - repoName: normalizedRepoName, - isPublic: repoVisibility, - } + return this.cache.get(normalizedRepoName) } public async getRepoMetadataUsingRepoName( @@ -57,7 +50,7 @@ export class GitHubDotComRepoMetadata { } const repoMetaData = await this.ghMetadataFromGit(repoBaseName, signal) if (repoMetaData) { - await localStorage.setGitHubRepoVisibility(repoBaseName, repoMetaData.isPublic) + this.cache.set(repoMetaData.repoName, repoMetaData) } return repoMetaData } diff --git a/vscode/src/services/LocalStorageProvider.ts b/vscode/src/services/LocalStorageProvider.ts index e6b366cda15d..9d15e9406ad2 100644 --- a/vscode/src/services/LocalStorageProvider.ts +++ b/vscode/src/services/LocalStorageProvider.ts @@ -32,7 +32,6 @@ class LocalStorage implements LocalStorageForModelPreferences { protected readonly CODY_ENDPOINT_HISTORY = 'SOURCEGRAPH_CODY_ENDPOINT_HISTORY' protected readonly CODY_ENROLLMENT_HISTORY = 'SOURCEGRAPH_CODY_ENROLLMENTS' protected readonly LAST_USED_CHAT_MODALITY = 'cody-last-used-chat-modality' - protected readonly GIT_REPO_VISIBILITY_KEY = 'cody-git-repo-visibility' public readonly ANONYMOUS_USER_ID_KEY = 'sourcegraphAnonymousUid' public readonly LAST_USED_ENDPOINT = 'SOURCEGRAPH_CODY_ENDPOINT' public readonly LAST_USED_USERNAME = 'SOURCEGRAPH_CODY_USERNAME' @@ -228,34 +227,6 @@ class LocalStorage implements LocalStorageForModelPreferences { return this.get(this.KEY_LOCAL_MINION_HISTORY) } - public async setGitHubRepoVisibility(repoName: string, visibility: boolean): Promise { - const visibilityKey = `${this.GIT_REPO_VISIBILITY_KEY}_${repoName}` - const visibilityValue = { - visibility: visibility, - timestamp: Date.now(), - } - await this.set(visibilityKey, visibilityValue) - } - - public getGitHubRepoVisibility(repoName: string): boolean | null { - const visibilityKey = `${this.GIT_REPO_VISIBILITY_KEY}_${repoName}` - const visibilityValue = this.get<{ visibility: boolean; timestamp: number } | null>( - visibilityKey - ) - - if (visibilityValue) { - const currentTime = Date.now() - const timeDifference = currentTime - visibilityValue.timestamp - // If the visibility value is older than 24 hours, delete it. - if (timeDifference > 24 * 60 * 60 * 1000) { - this.delete(visibilityKey) - return null - } - return visibilityValue.visibility - } - return null - } - public async removeChatHistory(authStatus: AuthenticatedAuthStatus): Promise { try { await this.setChatHistory(authStatus, { chat: {} })