Skip to content
Open
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
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1086,10 +1086,16 @@
"enum": [
"Plan"
]
},
"explainer": {
"type": "string",
"maxLength": 120,
"description": "A short user-facing explainer for benefits of switching (max 12 words). Shown in a confirmation dialog, so do not repeat it in your response."
}
Comment thread
digitarald marked this conversation as resolved.
},
"required": [
"agentName"
"agentName",
"explainer"
]
}
},
Expand Down Expand Up @@ -3324,6 +3330,15 @@
"onExp"
]
},
"github.copilot.chat.switchAgent.confirm": {
"type": "boolean",
"default": true,
"markdownDescription": "%github.copilot.config.switchAgent.confirm%",
"tags": [
"experimental",
"onExp"
]
},
Comment thread
digitarald marked this conversation as resolved.
"github.copilot.chat.imageUpload.enabled": {
"type": "boolean",
"default": true,
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
"github.copilot.config.anthropic.tools.websearch.blockedDomains": "List of domains to exclude from web search results (e.g., `[\"untrustedsource.com\"]`). Domains should not include the HTTP/HTTPS scheme. Subdomains are automatically excluded. Cannot be used together with allowed domains.",
"github.copilot.config.anthropic.tools.websearch.userLocation": "User location for personalizing web search results based on geographic context. All fields (city, region, country, timezone) are optional. Example: `{\"city\": \"San Francisco\", \"region\": \"California\", \"country\": \"US\", \"timezone\": \"America/Los_Angeles\"}`",
"github.copilot.config.switchAgent.enabled": "Allow agent to switch to the Plan agent for research, exploration, and planning tasks.",
"github.copilot.config.switchAgent.confirm": "Show a confirmation dialog before switching to a different agent.",
"github.copilot.config.completionsFetcher": "Sets the fetcher used for the inline completions.",
"github.copilot.config.nesFetcher": "Sets the fetcher used for the next edit suggestions.",
"github.copilot.config.debug.overrideChatEngine": "Override the chat model. This allows you to test with different models.\n\n**Note**: This is an advanced debugging setting and should not be used while self-hosting as it may lead to a different experience compared to end-users.",
Expand Down
11 changes: 10 additions & 1 deletion src/extension/tools/vscode-node/switchAgentTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ICopilotTool, ToolRegistry } from '../common/toolsRegistry';

interface ISwitchAgentParams {
agentName: string;
explainer: string;
}

export class SwitchAgentTool implements ICopilotTool<ISwitchAgentParams> {
Expand Down Expand Up @@ -46,9 +47,17 @@ export class SwitchAgentTool implements ICopilotTool<ISwitchAgentParams> {
throw new Error(vscode.l10n.t('Only "Plan" agent is supported. Received: "{0}"', agentName));
}

const confirmationEnabled = vscode.workspace.getConfiguration('github.copilot.chat').get<boolean>('switchAgent.confirm', true);
const explainer = options.input.explainer?.trim();
return {
invocationMessage: new MarkdownString(vscode.l10n.t('Switching to {0} agent', agentName)),
pastTenseMessage: new MarkdownString(vscode.l10n.t('Switched to {0} agent', agentName))
pastTenseMessage: new MarkdownString(vscode.l10n.t('Switched to {0} agent', agentName)),
...confirmationEnabled && explainer ? {
confirmationMessages: {
title: vscode.l10n.t('Switch to {0} Agent', agentName),
message: new MarkdownString().appendText(explainer),
},
Comment thread
digitarald marked this conversation as resolved.
} : {},
};
}
}
Expand Down
1 change: 1 addition & 0 deletions src/platform/configuration/common/configurationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ export namespace ConfigKey {
export const CloudAgentEnabled = defineSetting<boolean>('chat.cloudAgent.enabled', ConfigType.Simple, true);
export const AdditionalReadAccessPaths = defineSetting<string[]>('chat.additionalReadAccessPaths', ConfigType.Simple, []);
export const SwitchAgentEnabled = defineSetting<boolean>('chat.switchAgent.enabled', ConfigType.ExperimentBased, false);
export const SwitchAgentConfirm = defineSetting<boolean>('chat.switchAgent.confirm', ConfigType.Simple, true);

/** Additional tools to enable for the Plan agent (additive to base tools) */
export const PlanAgentAdditionalTools = defineSetting<string[]>('chat.planAgent.additionalTools', ConfigType.Simple, []);
Expand Down
Loading