Skip to content

Commit 4a3b8de

Browse files
authored
Remove experimental setting for retrying after filtered response (#830)
1 parent 6a0f6fe commit 4a3b8de

File tree

4 files changed

+9
-34
lines changed

4 files changed

+9
-34
lines changed

package.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,14 +2918,6 @@
29182918
},
29192919
"markdownDescription": "Configure custom OpenAI-compatible models. Each key should be a unique model ID, and the value should be an object with model configuration including name, url, toolCalling, vision, maxInputTokens, and maxOutputTokens properties."
29202920
},
2921-
"github.copilot.chat.enableRetryAfterFilteredResponse": {
2922-
"type": "boolean",
2923-
"default": true,
2924-
"tags": [
2925-
"experimental"
2926-
],
2927-
"description": "%github.copilot.config.retryAfterFilteredResponse.enabled%"
2928-
},
29292921
"github.copilot.chat.alternateGptPrompt.enabled": {
29302922
"type": "boolean",
29312923
"default": false,

package.nls.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
"github.copilot.config.setupTests.enabled": "Enables the `/setupTests` intent and prompting in `/tests` generation.",
133133
"github.copilot.config.byok.ollamaEndpoint": "The endpoint to use for the Ollama when accessed via bring your own key. Defaults to localhost.",
134134
"github.copilot.config.virtualTools.threshold": "This setting defines the tool count over which virtual tools should be used. Virtual tools group similar sets of tools together and they allow the model to activate them on-demand. Certain tool groups will optimistically be pre-activated. We are actively developing this feature and you experience degraded tool calling once the threshold is hit.\n\nMay be set to `0` to disable virtual tools.",
135-
"github.copilot.config.retryAfterFilteredResponse.enabled": "Enables retrying after a filtered response. If enabled, Copilot Chat will retry the request after a content filter blocks the response.",
136135
"github.copilot.config.alternateGptPrompt.enabled": "Enables an experimental alternate prompt for GPT models instead of the default prompt.",
137136
"github.copilot.config.gpt5AlternatePrompt": "Specifies an experimental alternate prompt to use for GPT-5 models.",
138137
"github.copilot.config.grokCodeAlternatePrompt": "Specifies an experimental alternate prompt to use for Grok Code models.",

src/extension/prompt/node/chatMLFetcher.ts

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { ChatFetchError, ChatFetchResponseType, ChatFetchRetriableError, ChatLoc
1212
import { IConversationOptions } from '../../../platform/chat/common/conversationOptions';
1313
import { getTextPart, toTextParts } from '../../../platform/chat/common/globalStringUtils';
1414
import { IInteractionService } from '../../../platform/chat/common/interactionService';
15-
import { ConfigKey, HARD_TOOL_LIMIT, IConfigurationService } from '../../../platform/configuration/common/configurationService';
15+
import { HARD_TOOL_LIMIT } from '../../../platform/configuration/common/configurationService';
1616
import { ICAPIClientService } from '../../../platform/endpoint/common/capiClient';
1717
import { IDomainService } from '../../../platform/endpoint/common/domainService';
1818
import { IEnvService } from '../../../platform/env/common/envService';
@@ -23,7 +23,6 @@ import { IChatEndpoint } from '../../../platform/networking/common/networking';
2323
import { ChatCompletion, FilterReason, FinishedCompletionReason } from '../../../platform/networking/common/openai';
2424
import { ChatFailKind, ChatRequestCanceled, ChatRequestFailed, ChatResults, fetchAndStreamChat, FetchResponseKind } from '../../../platform/openai/node/fetch';
2525
import { IRequestLogger } from '../../../platform/requestLogger/node/requestLogger';
26-
import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService';
2726
import { ITelemetryService, TelemetryProperties } from '../../../platform/telemetry/common/telemetry';
2827
import { TelemetryData } from '../../../platform/telemetry/common/telemetryData';
2928
import { calculateLineRepetitionStats, isRepetitive } from '../../../util/common/anomalyDetection';
@@ -93,8 +92,6 @@ export class ChatMLFetcherImpl extends AbstractChatMLFetcher {
9392
@IInteractionService private readonly _interactionService: IInteractionService,
9493
@IChatQuotaService private readonly _chatQuotaService: IChatQuotaService,
9594
@IConversationOptions options: IConversationOptions,
96-
@IConfigurationService private readonly configurationService: IConfigurationService,
97-
@IExperimentationService private readonly experimentationService: IExperimentationService,
9895
) {
9996
super(options);
10097
}
@@ -496,28 +493,16 @@ export class ChatMLFetcherImpl extends AbstractChatMLFetcher {
496493

497494
const result = completions.at(0);
498495

499-
const isRetryAfterFilteredResponseEnabled = this.configurationService.getExperimentBasedConfig(ConfigKey.EnableRetryAfterFilteredResponse, this.experimentationService);
500-
501496
switch (result?.finishReason) {
502497
case FinishedCompletionReason.ContentFilter:
503-
if (isRetryAfterFilteredResponseEnabled) {
504-
return {
505-
type: ChatFetchResponseType.FilteredRetry,
506-
category: result.filterReason ?? FilterReason.Copyright,
507-
reason: 'Response got filtered.',
508-
value: completions.map(c => getTextPart(c.message.content)),
509-
requestId: requestId,
510-
serverRequestId: result.requestId.headerRequestId,
511-
};
512-
} else {
513-
return {
514-
type: ChatFetchResponseType.Filtered,
515-
category: result.filterReason ?? FilterReason.Copyright,
516-
reason: 'Response got filtered.',
517-
requestId: requestId,
518-
serverRequestId: result.requestId.headerRequestId
519-
};
520-
}
498+
return {
499+
type: ChatFetchResponseType.FilteredRetry,
500+
category: result.filterReason ?? FilterReason.Copyright,
501+
reason: 'Response got filtered.',
502+
value: completions.map(c => getTextPart(c.message.content)),
503+
requestId: requestId,
504+
serverRequestId: result.requestId.headerRequestId,
505+
};
521506
case FinishedCompletionReason.Length:
522507
return {
523508
type: ChatFetchResponseType.Length,

src/platform/configuration/common/configurationService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,6 @@ export namespace ConfigKey {
784784
export const UseAlternativeNESNotebookFormat = defineExpSetting<boolean>('chat.notebook.enhancedNextEditSuggestions.enabled', false);
785785
export const CustomInstructionsInSystemMessage = defineSetting<boolean>('chat.customInstructionsInSystemMessage', true);
786786

787-
export const EnableRetryAfterFilteredResponse = defineExpSetting<boolean>('chat.enableRetryAfterFilteredResponse', true);
788787
export const EnableAlternateGptPrompt = defineExpSetting<boolean>('chat.alternateGptPrompt.enabled', false);
789788
export const Gpt5AlternatePrompt = defineExpSetting<string>('chat.gpt5AlternatePrompt', 'default');
790789
export const GrokCodeAlternatePrompt = defineExpSetting<string>('chat.grokCodeAlternatePrompt', 'default');

0 commit comments

Comments
 (0)