From 5fbcdfe2dc4e9435715ab06fed46ef90c116834a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 18:24:24 +0000 Subject: [PATCH 1/2] Initial plan From 886654d20f6f20b7f7a9835d0099394a7aba1ac0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 18:26:26 +0000 Subject: [PATCH 2/2] Fix: Show user-friendly error when Copilot Chat is not installed before opening chat Agent-Logs-Url: https://github.com/microsoft/vscode-azureresourcegroups/sessions/099c4f86-b23d-4731-ac21-ba230a3ca969 Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com> --- .../askAgentAboutActivityLog/askAgentAboutActivityLog.ts | 5 +++++ src/chat/askAgentAboutResource.ts | 5 +++++ src/chat/askAzure.ts | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/chat/askAgentAboutActivityLog/askAgentAboutActivityLog.ts b/src/chat/askAgentAboutActivityLog/askAgentAboutActivityLog.ts index 80a7172cd..f67e2306f 100644 --- a/src/chat/askAgentAboutActivityLog/askAgentAboutActivityLog.ts +++ b/src/chat/askAgentAboutActivityLog/askAgentAboutActivityLog.ts @@ -5,6 +5,7 @@ import { IActionContext } from "@microsoft/vscode-azext-utils"; import * as vscode from "vscode"; +import { ensureCopilotChatReady } from "../../commands/copilotOnRails/openChatWithAgent"; import { ext } from "../../extensionVariables"; import { ActivityItem } from "../../tree/activityLog/ActivityItem"; import { TreeDataItem } from "../../tree/ResourceGroupsItem"; @@ -45,6 +46,10 @@ export async function askAgentAboutActivityLog(context: IActionContext, item?: A } } + if (!(await ensureCopilotChatReady())) { + return; + } + await vscode.commands.executeCommand("workbench.action.chat.newChat"); await vscode.commands.executeCommand("workbench.action.chat.open", { mode: 'agent', query: genericActivityLogPrompt }); } diff --git a/src/chat/askAgentAboutResource.ts b/src/chat/askAgentAboutResource.ts index e0b9d6b53..18bd3d6d3 100644 --- a/src/chat/askAgentAboutResource.ts +++ b/src/chat/askAgentAboutResource.ts @@ -5,6 +5,7 @@ import { IActionContext } from "@microsoft/vscode-azext-utils"; import * as vscode from "vscode"; +import { ensureCopilotChatReady } from "../commands/copilotOnRails/openChatWithAgent"; const agentName = "azure"; @@ -18,6 +19,10 @@ export const askAgentAboutResourcePrompt = vscode.l10n.t(`I'd like to ask you ab export async function askAgentAboutResource(_actionContext: IActionContext, node?: { id?: string, value?: { armId: string }, resource?: { kind?: string } }) { const resourceId = node?.id ?? node?.value?.armId; if (resourceId !== undefined) { + if (!(await ensureCopilotChatReady())) { + return; + } + const prompt = `@${agentName} ${askAgentAboutResourcePrompt}`; await vscode.commands.executeCommand("workbench.action.chat.newChat"); diff --git a/src/chat/askAzure.ts b/src/chat/askAzure.ts index 030806543..95a65e9b9 100644 --- a/src/chat/askAzure.ts +++ b/src/chat/askAzure.ts @@ -5,8 +5,13 @@ import { IActionContext } from "@microsoft/vscode-azext-utils"; import * as vscode from "vscode"; +import { ensureCopilotChatReady } from "../commands/copilotOnRails/openChatWithAgent"; export async function askAzureInCommandPalette(context: IActionContext, prompt?: string) { + if (!(await ensureCopilotChatReady())) { + return; + } + if (!prompt) { prompt = await context.ui.showInputBox({ prompt: vscode.l10n.t(`What do you want to ask about Azure?`) }); }