Display github copilot tools in Sessions Window (#299314)

* Display github copilot tools in Sessions Window

* Update src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Don Jayamanne
2026-03-05 17:43:23 +11:00
committed by GitHub
parent 7344939be3
commit bcd6b6b1df

View File

@@ -21,6 +21,7 @@ import { localize } from '../../../../../../nls.js';
import { formatArrayValue, getQuotePreference } from '../utils/promptEditHelper.js';
import { HOOKS_BY_TARGET, HOOK_METADATA } from '../hookTypes.js';
import { HOOK_COMMAND_FIELD_DESCRIPTIONS } from '../hookSchema.js';
import { IWorkbenchEnvironmentService } from '../../../../../services/environment/common/environmentService.js';
import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js';
import { PromptsConfig } from '../config/config.js';
@@ -40,6 +41,7 @@ export class PromptHeaderAutocompletion implements CompletionItemProvider {
@ILanguageModelsService private readonly languageModelsService: ILanguageModelsService,
@ILanguageModelToolsService private readonly languageModelToolsService: ILanguageModelToolsService,
@IChatModeService private readonly chatModeService: IChatModeService,
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@IConfigurationService private readonly configurationService: IConfigurationService,
) {
}
@@ -221,8 +223,8 @@ export class PromptHeaderAutocompletion implements CompletionItemProvider {
if (value.type === 'sequence') {
// if the position is inside the tools metadata, we provide tool name completions
const getValues = async () => {
if (target === Target.GitHubCopilot) {
// for GitHub Copilot agent files, we only suggest the known set of tools that are supported by GitHub Copilot, instead of all tools that the user has defined, because many tools won't work with GitHub Copilot and it would be frustrating for users to select a tool that doesn't work
if (target === Target.GitHubCopilot || this.environmentService.isSessionsWindow) {
// for GitHub Copilot targets and the Sessions Window, we only suggest the known set of tools that are supported by GitHub Copilot, instead of all tools that the user has defined, because many tools won't work in these contexts and it would be frustrating for users to select a tool that doesn't work
return knownGithubCopilotTools;
} else if (target === Target.Claude) {
return knownClaudeTools;