Skip to content

Commit 01d4012

Browse files
authored
Remove agent killswitch (microsoft#255007)
1 parent 8e55c8d commit 01d4012

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/vs/workbench/contrib/chat/common/chatServiceImpl.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ import { Progress } from '../../../../platform/progress/common/progress.js';
2525
import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
2626
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
2727
import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js';
28-
import { IWorkbenchAssignmentService } from '../../../services/assignment/common/assignmentService.js';
2928
import { IExtensionService } from '../../../services/extensions/common/extensions.js';
3029
import { IChatAgent, IChatAgentCommand, IChatAgentData, IChatAgentHistoryEntry, IChatAgentRequest, IChatAgentResult, IChatAgentService } from './chatAgents.js';
3130
import { ChatModel, ChatRequestModel, ChatRequestRemovalReason, IChatModel, IChatRequestModel, IChatRequestVariableData, IChatResponseModel, IExportableChatData, ISerializableChatData, ISerializableChatDataIn, ISerializableChatsData, normalizeSerializableChatData, toChatHistoryContent, updateRanges } from './chatModel.js';
32-
import { ChatRequestAgentPart, ChatRequestAgentSubcommandPart, ChatRequestSlashCommandPart, IParsedChatRequest, chatAgentLeader, chatSubcommandLeader, getPromptText } from './chatParserTypes.js';
31+
import { chatAgentLeader, ChatRequestAgentPart, ChatRequestAgentSubcommandPart, ChatRequestSlashCommandPart, chatSubcommandLeader, getPromptText, IParsedChatRequest } from './chatParserTypes.js';
3332
import { ChatRequestParser } from './chatRequestParser.js';
3433
import { IChatCompleteResponse, IChatDetail, IChatFollowup, IChatProgress, IChatSendRequestData, IChatSendRequestOptions, IChatSendRequestResponseState, IChatService, IChatTransferredSessionData, IChatUserActionEvent } from './chatService.js';
3534
import { ChatServiceTelemetry } from './chatServiceTelemetry.js';
@@ -161,7 +160,6 @@ export class ChatService extends Disposable implements IChatService {
161160
@IChatSlashCommandService private readonly chatSlashCommandService: IChatSlashCommandService,
162161
@IChatAgentService private readonly chatAgentService: IChatAgentService,
163162
@IConfigurationService private readonly configurationService: IConfigurationService,
164-
@IWorkbenchAssignmentService private readonly experimentService: IWorkbenchAssignmentService,
165163
@IChatTransferService private readonly chatTransferService: IChatTransferService,
166164
@ILanguageModelsService private readonly languageModelsService: ILanguageModelsService,
167165
) {
@@ -804,7 +802,6 @@ export class ChatService extends Disposable implements IChatService {
804802
const agent = (detectedAgent ?? agentPart?.agent ?? defaultAgent)!;
805803
const command = detectedCommand ?? agentSlashCommandPart?.command;
806804
await this.extensionService.activateByEvent(`onChatParticipant:${agent.id}`);
807-
await this.checkAgentAllowed(agent);
808805

809806
// Recompute history in case the agent or command changed
810807
const history = this.getHistoryEntriesFromModel(requests, model.sessionId, location, agent.id);
@@ -959,15 +956,6 @@ export class ChatService extends Disposable implements IChatService {
959956
return attachedContextVariables;
960957
}
961958

962-
private async checkAgentAllowed(agent: IChatAgentData): Promise<void> {
963-
if (agent.modes.includes(ChatModeKind.Agent)) {
964-
const enabled = await this.experimentService.getTreatment<boolean>('chatAgentEnabled');
965-
if (enabled === false) {
966-
throw new Error('Agent is currently disabled');
967-
}
968-
}
969-
}
970-
971959
private attachmentKindsForTelemetry(variableData: IChatRequestVariableData): string[] {
972960
// TODO this shows why attachments still have to be cleaned up somewhat
973961
return variableData.variables.map(v => {

0 commit comments

Comments
 (0)