Skip to content

Commit 0b98377

Browse files
authored
Cleaup old exp (#1254)
1 parent 46fc032 commit 0b98377

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

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

Lines changed: 3 additions & 3 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 } from '../../../platform/endpoint/common/autoChatEndpoint';
15+
import { AutoChatEndpoint } 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';
@@ -58,7 +58,6 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
5858
@IEndpointProvider private readonly _endpointProvider: IEndpointProvider,
5959
@IEmbeddingsComputer private readonly _embeddingsComputer: IEmbeddingsComputer,
6060
@IVSCodeExtensionContext private readonly _vsCodeExtensionContext: IVSCodeExtensionContext,
61-
@IExperimentationService private readonly _expService: IExperimentationService,
6261
@IAutomodeService private readonly _automodeService: IAutomodeService
6362
) {
6463
super();
@@ -113,7 +112,8 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
113112
let defaultChatEndpoint = chatEndpoints.find(e => e.isDefault) ?? await this._endpointProvider.getChatEndpoint('gpt-4.1') ?? chatEndpoints[0];
114113
const autoEndpoint = await this._automodeService.resolveAutoModeEndpoint(undefined, chatEndpoints);
115114
chatEndpoints.push(autoEndpoint);
116-
if (isAutoModelDefault(this._expService, this._authenticationService)) {
115+
// No Auth users always get Auto as the default model
116+
if (this._authenticationService.copilotToken?.isNoAuthUser) {
117117
defaultChatEndpoint = autoEndpoint;
118118
}
119119
const seenFamilies = new Set<string>();

src/platform/endpoint/common/autoChatEndpoint.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ import { Raw } from '@vscode/prompt-tsx';
88
import type { CancellationToken } from 'vscode';
99
import { ITokenizer, TokenizerType } from '../../../util/common/tokenizer';
1010
import { AsyncIterableObject } from '../../../util/vs/base/common/async';
11-
import { IAuthenticationService } from '../../authentication/common/authentication';
1211
import { IChatMLFetcher, Source } from '../../chat/common/chatMLFetcher';
1312
import { ChatLocation, ChatResponse } from '../../chat/common/commonTypes';
1413
import { ILogService } from '../../log/common/logService';
1514
import { FinishedCallback, OptionalChatRequestParams } from '../../networking/common/fetch';
1615
import { Response } from '../../networking/common/fetcherService';
1716
import { IChatEndpoint, ICreateEndpointBodyOptions, IEndpointBody, IMakeChatRequestOptions } from '../../networking/common/networking';
1817
import { ChatCompletion } from '../../networking/common/openai';
19-
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
2018
import { ITelemetryService, TelemetryProperties } from '../../telemetry/common/telemetry';
2119
import { TelemetryData } from '../../telemetry/common/telemetryData';
2220

@@ -116,17 +114,4 @@ export class AutoChatEndpoint implements IChatEndpoint {
116114
telemetryProperties,
117115
}, token);
118116
}
119-
}
120-
121-
/**
122-
* Checks if the auto chat model is the default model
123-
* @param expService The experimentation service to use to check if the auto model is the default
124-
* @param authService The authentication service to use to check if the auto model is the default
125-
* @returns True if the auto model is the default, false otherwise
126-
*/
127-
export function isAutoModelDefault(expService: IExperimentationService, authService: IAuthenticationService) {
128-
if (authService.copilotToken?.isNoAuthUser) {
129-
return true;
130-
}
131-
return !!expService.getTreatmentVariable<boolean>('autoModelDefault');
132-
}
117+
}

0 commit comments

Comments
 (0)