Skip to content

Comments

Use askQuestions tool in memory slash command when invoked from chat context#3897

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/update-clause-agent-invocation
Draft

Use askQuestions tool in memory slash command when invoked from chat context#3897
Copilot wants to merge 5 commits intomainfrom
copilot/update-clause-agent-invocation

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

The /memory slash command used QuickPick UI unconditionally. When invoked from a chat context, it should use the askQuestions tool instead for inline UX. The presence of toolInvocationToken distinguishes chat invocation from Command Palette invocation.

Changes

  • Thread toolInvocationToken through slash command layer: Added optional param to IClaudeSlashCommandHandler.handle() and IClaudeSlashCommandService.tryHandleCommand(), passed from request.toolInvocationToken at the call site in claudeChatSessionContentProvider.ts
  • MemorySlashCommand: branch on token presence: When toolInvocationToken is present, invoke CoreAskQuestions via IToolsService.invokeTool() with memory locations as question options. Falls back to existing QuickPick path when absent (Command Palette).
async handle(
    _args: string,
    stream: vscode.ChatResponseStream | undefined,
    _token: CancellationToken,
    toolInvocationToken?: vscode.ChatParticipantToolToken
): Promise<vscode.ChatResult> {
    if (toolInvocationToken) {
        return this._handleWithAskQuestions(stream, toolInvocationToken);
    }
    // existing QuickPick path
}

Tests

New memoryCommand.spec.ts covering: tool invocation with token, skipped answers, empty responses, tool errors.

Original prompt

In the memory slash command for the Claude agent integration, I want the slash command invocation to use the askQuestions tool instead of the quick picks.

I think you'll need to pass down the chatinvocationtoken and use the presence of that as a signal to use either the quick picks or the tool.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 20, 2026 17:12
…n is present

Thread toolInvocationToken through the slash command interface and service,
and modify MemorySlashCommand to use the askQuestions tool (instead of
QuickPick) when invoked from a chat context with a toolInvocationToken.

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot AI changed the title [WIP] Update memory slash command to use askQuestions tool Use askQuestions tool in memory slash command when invoked from chat context Feb 20, 2026
Copilot AI requested a review from TylerLeonhardt February 20, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants