Skip to content

Commit eebb448

Browse files
authored
Remove auto mode enablement exp (#1236)
1 parent 93e97f0 commit eebb448

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

src/extension/conversation/vscode-node/languageModelAccess.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IBlockedExtensionService } from '../../../platform/chat/common/blockedE
1212
import { ChatFetchResponseType, ChatLocation, getErrorDetailsFromChatFetchError } from '../../../platform/chat/common/commonTypes';
1313
import { getTextPart } from '../../../platform/chat/common/globalStringUtils';
1414
import { EmbeddingType, getWellKnownEmbeddingTypeInfo, IEmbeddingsComputer } from '../../../platform/embeddings/common/embeddingsComputer';
15-
import { AutoChatEndpoint, isAutoModelDefault, isAutoModelEnabled } from '../../../platform/endpoint/common/autoChatEndpoint';
15+
import { AutoChatEndpoint, isAutoModelDefault } from '../../../platform/endpoint/common/autoChatEndpoint';
1616
import { IAutomodeService } from '../../../platform/endpoint/common/automodeService';
1717
import { IEndpointProvider } from '../../../platform/endpoint/common/endpointProvider';
1818
import { CustomDataPartMimeTypes } from '../../../platform/endpoint/common/endpointTypes';
@@ -59,8 +59,7 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
5959
@IEmbeddingsComputer private readonly _embeddingsComputer: IEmbeddingsComputer,
6060
@IVSCodeExtensionContext private readonly _vsCodeExtensionContext: IVSCodeExtensionContext,
6161
@IExperimentationService private readonly _expService: IExperimentationService,
62-
@IAutomodeService private readonly _automodeService: IAutomodeService,
63-
@IEnvService private readonly _envService: IEnvService
62+
@IAutomodeService private readonly _automodeService: IAutomodeService
6463
) {
6564
super();
6665

@@ -112,12 +111,10 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
112111
const chatEndpoints = await this._endpointProvider.getAllChatEndpoints();
113112

114113
let defaultChatEndpoint = chatEndpoints.find(e => e.isDefault) ?? await this._endpointProvider.getChatEndpoint('gpt-4.1') ?? chatEndpoints[0];
115-
if (await isAutoModelEnabled(this._expService, this._envService, this._authenticationService)) {
116-
const autoEndpoint = await this._automodeService.resolveAutoModeEndpoint(undefined, chatEndpoints);
117-
chatEndpoints.push(autoEndpoint);
118-
if (isAutoModelDefault(this._expService, this._authenticationService)) {
119-
defaultChatEndpoint = autoEndpoint;
120-
}
114+
const autoEndpoint = await this._automodeService.resolveAutoModeEndpoint(undefined, chatEndpoints);
115+
chatEndpoints.push(autoEndpoint);
116+
if (isAutoModelDefault(this._expService, this._authenticationService)) {
117+
defaultChatEndpoint = autoEndpoint;
121118
}
122119
const seenFamilies = new Set<string>();
123120

src/platform/endpoint/common/autoChatEndpoint.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { AsyncIterableObject } from '../../../util/vs/base/common/async';
1111
import { IAuthenticationService } from '../../authentication/common/authentication';
1212
import { IChatMLFetcher, Source } from '../../chat/common/chatMLFetcher';
1313
import { ChatLocation, ChatResponse } from '../../chat/common/commonTypes';
14-
import { IEnvService } from '../../env/common/envService';
1514
import { ILogService } from '../../log/common/logService';
1615
import { FinishedCallback, OptionalChatRequestParams } from '../../networking/common/fetch';
1716
import { Response } from '../../networking/common/fetcherService';
@@ -119,28 +118,6 @@ export class AutoChatEndpoint implements IChatEndpoint {
119118
}
120119
}
121120

122-
/**
123-
* Checks if the auto chat mode is enabled.
124-
* @param expService The experimentation service to use to check if the auto mode is enabled
125-
* @param envService The environment service to use to check if the auto mode is enabled
126-
* @returns True if the auto mode is enabled, false otherwise
127-
*/
128-
export async function isAutoModelEnabled(expService: IExperimentationService, envService: IEnvService, authService: IAuthenticationService): Promise<boolean> {
129-
if (envService.isPreRelease() || authService.copilotToken?.isNoAuthUser) {
130-
return true;
131-
}
132-
133-
if (!!expService.getTreatmentVariable<boolean>('autoModelEnabled')) {
134-
try {
135-
return (await authService.getCopilotToken()).isEditorPreviewFeaturesEnabled();
136-
} catch (e) {
137-
return false;
138-
}
139-
}
140-
141-
return false;
142-
}
143-
144121
/**
145122
* Checks if the auto chat model is the default model
146123
* @param expService The experimentation service to use to check if the auto model is the default

0 commit comments

Comments
 (0)