Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/extension/byok/node/openAIEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ILogService } from '../../../platform/log/common/logService';
import { isOpenAiFunctionTool } from '../../../platform/networking/common/fetch';
import { createCapiRequestBody, IChatEndpoint, ICreateEndpointBodyOptions, IEndpointBody, IMakeChatRequestOptions } from '../../../platform/networking/common/networking';
import { RawMessageConversionCallback } from '../../../platform/networking/common/openai';
import { IChatWebSocketManager } from '../../../platform/networking/node/chatWebSocketManager';
import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService';
import { ITokenizerProvider } from '../../../platform/tokenizer/node/tokenizer';
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
Expand Down Expand Up @@ -119,6 +120,7 @@ export class OpenAIEndpoint extends ChatEndpoint {
@IInstantiationService protected instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService,
@IExperimentationService expService: IExperimentationService,
@IChatWebSocketManager chatWebSocketService: IChatWebSocketManager,
@ILogService protected logService: ILogService
) {
super(
Expand All @@ -129,6 +131,7 @@ export class OpenAIEndpoint extends ChatEndpoint {
instantiationService,
configurationService,
expService,
chatWebSocketService,
logService
);
this._customHeaders = this._sanitizeCustomHeaders(_modelMetadata.requestHeaders);
Expand Down
3 changes: 3 additions & 0 deletions src/extension/xtab/node/xtabEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { IChatModelInformation } from '../../../platform/endpoint/common/endpoin
import { ChatEndpoint } from '../../../platform/endpoint/node/chatEndpoint';
import { ILogService } from '../../../platform/log/common/logService';
import { IFetcherService } from '../../../platform/networking/common/fetcherService';
import { IChatWebSocketManager } from '../../../platform/networking/node/chatWebSocketManager';
import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../../platform/telemetry/common/telemetry';
import { ITokenizerProvider } from '../../../platform/tokenizer/node/tokenizer';
Expand Down Expand Up @@ -60,6 +61,7 @@ export class XtabEndpoint extends ChatEndpoint {
@ITokenizerProvider _tokenizerProvider: ITokenizerProvider,
@IInstantiationService _instantiationService: IInstantiationService,
@IExperimentationService _experimentationService: IExperimentationService,
@IChatWebSocketManager _chatWebSocketService: IChatWebSocketManager,
@ILogService _logService: ILogService
) {
const chatModelInfo = _configuredModelName ? { ...XtabEndpoint.chatModelInfo, id: _configuredModelName } : XtabEndpoint.chatModelInfo;
Expand All @@ -71,6 +73,7 @@ export class XtabEndpoint extends ChatEndpoint {
_instantiationService,
_configService,
_experimentationService,
_chatWebSocketService,
_logService
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/platform/endpoint/node/autoChatEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { IEnvService } from '../../env/common/envService';
import { ILogService } from '../../log/common/logService';
import { IFetcherService } from '../../networking/common/fetcherService';
import { IChatEndpoint } from '../../networking/common/networking';
import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManager';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../telemetry/common/telemetry';
import { ITokenizerProvider } from '../../tokenizer/node/tokenizer';
Expand Down Expand Up @@ -43,6 +44,7 @@ export class AutoChatEndpoint extends CopilotChatEndpoint {
@IInstantiationService _instantiationService: IInstantiationService,
@IConfigurationService _configurationService: IConfigurationService,
@IExperimentationService _expService: IExperimentationService,
@IChatWebSocketManager _chatWebSocketService: IChatWebSocketManager,
@ILogService _logService: ILogService,
) {
super(
Expand All @@ -58,6 +60,7 @@ export class AutoChatEndpoint extends CopilotChatEndpoint {
_instantiationService,
_configurationService,
_expService,
_chatWebSocketService,
_logService
);
}
Expand Down
11 changes: 10 additions & 1 deletion src/platform/endpoint/node/chatEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { IFetcherService, Response } from '../../networking/common/fetcherServic
import { createCapiRequestBody, IChatEndpoint, ICreateEndpointBodyOptions, IEndpointBody, IMakeChatRequestOptions } from '../../networking/common/networking';
import { CAPIChatMessage, ChatCompletion, FinishedCompletionReason, RawMessageConversionCallback } from '../../networking/common/openai';
import { prepareChatCompletionForReturn } from '../../networking/node/chatStream';
import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManager';
import { SSEProcessor } from '../../networking/node/stream';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITelemetryService, TelemetryProperties } from '../../telemetry/common/telemetry';
Expand Down Expand Up @@ -142,6 +143,7 @@ export class ChatEndpoint implements IChatEndpoint {
@IInstantiationService protected readonly _instantiationService: IInstantiationService,
@IConfigurationService protected readonly _configurationService: IConfigurationService,
@IExperimentationService private readonly _expService: IExperimentationService,
@IChatWebSocketManager private readonly _chatWebSocketService: IChatWebSocketManager,
@ILogService _logService: ILogService,
) {
// This metadata should always be present, but if not we will default to 8192 tokens
Expand Down Expand Up @@ -392,7 +394,12 @@ export class ChatEndpoint implements IChatEndpoint {
&& this.apiType === 'responses'
&& this._configurationService.getExperimentBasedConfig(ConfigKey.TeamInternal.ResponsesApiWebSocketEnabled, this._expService)
);
const ignoreStatefulMarker = options.ignoreStatefulMarker ?? !useWebSocket;
const ignoreStatefulMarker = options.ignoreStatefulMarker ?? !(
useWebSocket
&& options.conversationId
&& options.turnId
&& this._chatWebSocketService.hasActiveConnection(options.conversationId, options.turnId)
);
const response = await this._makeChatRequest2({
...options,
useWebSocket,
Expand Down Expand Up @@ -460,6 +467,7 @@ export class RemoteAgentChatEndpoint extends ChatEndpoint {
@IInstantiationService instantiationService: IInstantiationService,
@IConfigurationService configService: IConfigurationService,
@IExperimentationService experimentService: IExperimentationService,
@IChatWebSocketManager chatWebSocketService: IChatWebSocketManager,
@ILogService logService: ILogService
) {
super(
Expand All @@ -470,6 +478,7 @@ export class RemoteAgentChatEndpoint extends ChatEndpoint {
instantiationService,
configService,
experimentService,
chatWebSocketService,
logService
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/platform/endpoint/node/copilotChatEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { IEnvService } from '../../env/common/envService';
import { ILogService } from '../../log/common/logService';
import { IFetcherService } from '../../networking/common/fetcherService';
import { RawMessageConversionCallback } from '../../networking/common/openai';
import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManager';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../telemetry/common/telemetry';
import { ITokenizerProvider } from '../../tokenizer/node/tokenizer';
Expand All @@ -33,6 +34,7 @@ export class CopilotChatEndpoint extends ChatEndpoint {
@IInstantiationService instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService,
@IExperimentationService experimentService: IExperimentationService,
@IChatWebSocketManager chatWebSocketService: IChatWebSocketManager,
@ILogService logService: ILogService
) {
super(
Expand All @@ -43,6 +45,7 @@ export class CopilotChatEndpoint extends ChatEndpoint {
instantiationService,
configurationService,
experimentService,
chatWebSocketService,
logService
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/platform/endpoint/node/proxy4oEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { IChatMLFetcher } from '../../chat/common/chatMLFetcher';
import { ConfigKey, IConfigurationService } from '../../configuration/common/configurationService';
import { ILogService } from '../../log/common/logService';
import { IFetcherService } from '../../networking/common/fetcherService';
import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManager';
import { IProxyModelsService } from '../../proxyModels/common/proxyModelsService';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITokenizerProvider } from '../../tokenizer/node/tokenizer';
Expand All @@ -36,6 +37,7 @@ export class Proxy4oEndpoint extends ChatEndpoint {
@IInstantiationService instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService,
@IExperimentationService experimentationService: IExperimentationService,
@IChatWebSocketManager chatWebSocketService: IChatWebSocketManager,
@ILogService logService: ILogService,
@IProxyModelsService proxyModelsService: IProxyModelsService,
) {
Expand Down Expand Up @@ -72,6 +74,7 @@ export class Proxy4oEndpoint extends ChatEndpoint {
instantiationService,
configurationService,
experimentationService,
chatWebSocketService,
logService
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/platform/endpoint/node/proxyAgenticSearchEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { IChatMLFetcher } from '../../chat/common/chatMLFetcher';
import { IConfigurationService } from '../../configuration/common/configurationService';
import { ILogService } from '../../log/common/logService';
import { IFetcherService } from '../../networking/common/fetcherService';
import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManager';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../telemetry/common/telemetry';
import { ITokenizerProvider } from '../../tokenizer/node/tokenizer';
Expand All @@ -33,6 +34,7 @@ export class ProxyAgenticSearchEndpoint extends ChatEndpoint {
@IInstantiationService instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService,
@IExperimentationService experimentationService: IExperimentationService,
@IChatWebSocketManager chatWebSocketService: IChatWebSocketManager,
@ILogService logService: ILogService,
) {
const model = modelName;
Expand Down Expand Up @@ -62,6 +64,7 @@ export class ProxyAgenticSearchEndpoint extends ChatEndpoint {
instantiationService,
configurationService,
experimentationService,
chatWebSocketService,
logService
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/platform/endpoint/node/proxyInstantApplyShortEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { IChatMLFetcher } from '../../chat/common/chatMLFetcher';
import { ConfigKey, IConfigurationService } from '../../configuration/common/configurationService';
import { ILogService } from '../../log/common/logService';
import { IFetcherService } from '../../networking/common/fetcherService';
import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManager';
import { IProxyModelsService } from '../../proxyModels/common/proxyModelsService';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../telemetry/common/telemetry';
Expand All @@ -34,6 +35,7 @@ export class ProxyInstantApplyShortEndpoint extends ChatEndpoint {
@IInstantiationService instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService,
@IExperimentationService experimentationService: IExperimentationService,
@IChatWebSocketManager chatWebSocketService: IChatWebSocketManager,
@ILogService logService: ILogService,
@IProxyModelsService proxyModelsService: IProxyModelsService,
) {
Expand Down Expand Up @@ -69,6 +71,7 @@ export class ProxyInstantApplyShortEndpoint extends ChatEndpoint {
instantiationService,
configurationService,
experimentationService,
chatWebSocketService,
logService
);
}
Expand Down
Loading