mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-29 17:07:50 +08:00
Merge pull request #320494 from microsoft/revert-320481-revert-320446-fortunate-basilisk
Disable background todo agent for experimental models
This commit is contained in:
@@ -109,6 +109,11 @@ export function isBackgroundTodoAgentEnabled(
|
||||
request: vscode.ChatRequest): boolean {
|
||||
const token = authenticationService.copilotToken;
|
||||
|
||||
// Disable background todo agent for experimental models temporarily
|
||||
if (endpoint.modelProvider?.toLowerCase() === 'experimental') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only enable for a signed in no-free plan user talking to the CAPI endpoint.
|
||||
const isEnabledForToken = token !== undefined && !token.isFreeUser && !token.isNoAuthUser && isCAPIEndpoint(endpoint);
|
||||
return isEnabledForToken && configurationService.getExperimentBasedConfig(ConfigKey.Advanced.BackgroundTodoAgentEnabled, experimentationService)
|
||||
|
||||
@@ -77,8 +77,8 @@ describe('isBackgroundTodoAgentEnabled', () => {
|
||||
|
||||
// CAPI endpoints carry a `RequestMetadata` object; BYOK/custom endpoints are
|
||||
// fetched from a literal URL string.
|
||||
const capiEndpoint = { urlOrRequestMetadata: { type: RequestType.ChatCompletions } } as unknown as IChatEndpoint;
|
||||
const byokEndpoint = { urlOrRequestMetadata: 'https://api.example.com/v1/chat' } as unknown as IChatEndpoint;
|
||||
const capiEndpoint = { urlOrRequestMetadata: { type: RequestType.ChatCompletions }, modelProvider: 'copilot' } as unknown as IChatEndpoint;
|
||||
const byokEndpoint = { urlOrRequestMetadata: 'https://api.example.com/v1/chat', modelProvider: 'custom' } as unknown as IChatEndpoint;
|
||||
|
||||
const paidToken = new CopilotToken(createTestExtendedTokenInfo({ sku: 'copilot_individual', copilot_plan: 'individual' }));
|
||||
const freeToken = new CopilotToken(createTestExtendedTokenInfo({ sku: 'free_limited_copilot' }));
|
||||
@@ -215,7 +215,7 @@ describe('AgentIntentInvocation._maybeStartBackgroundTodoAgentPass subagent guar
|
||||
// The helper now evaluates background-todo eligibility first, so these tests
|
||||
// provide a CAPI endpoint + paid auth + experiment enabled baseline and then
|
||||
// vary only the subagent fields to validate the guard behavior.
|
||||
const endpoint = { urlOrRequestMetadata: { type: RequestType.ChatCompletions } } as unknown as IChatEndpoint;
|
||||
const endpoint = { urlOrRequestMetadata: { type: RequestType.ChatCompletions }, modelProvider: '' } as unknown as IChatEndpoint;
|
||||
const paidToken = new CopilotToken(createTestExtendedTokenInfo({ sku: 'copilot_individual', copilot_plan: 'individual' }));
|
||||
|
||||
function makeStub(request: TestChatRequest, processorLookup: () => unknown) {
|
||||
|
||||
Reference in New Issue
Block a user