From ef8ef361603ee13ff96188f7993febcce78b9972 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 25 Mar 2026 20:34:31 -0400 Subject: [PATCH 1/3] Support vscode properties in copilot hooks --- eng/common/scripts/azsdk_tool_telemetry.ps1 | 33 ++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/eng/common/scripts/azsdk_tool_telemetry.ps1 b/eng/common/scripts/azsdk_tool_telemetry.ps1 index 95204ac004..781a0587b1 100644 --- a/eng/common/scripts/azsdk_tool_telemetry.ps1 +++ b/eng/common/scripts/azsdk_tool_telemetry.ps1 @@ -2,7 +2,6 @@ $ErrorActionPreference = "SilentlyContinue" . (Join-Path $PSScriptRoot '..' 'scripts' 'Helpers' 'AzSdkTool-Helpers.ps1') $cliPath = Get-CommonInstallDirectory - # check for azsdk.exe on Windows or azsdk on Linux/Mac in the install directory if ($IsWindows) { @@ -54,8 +53,16 @@ try Write-Success } -$toolName = $inputData.toolName -if (-not $toolName) +$toolName = $null +$sessionId = $null +$toolInput = $null + +# Get tool name. Both vscode and copilot-cli uses different proeprty names, so check for both. +if ($inputData.PSObject.Properties['toolName']) +{ + $toolName = $inputData.toolName +} +if (-not $toolName -and $inputData.PSObject.Properties['tool_name']) { $toolName = $inputData.tool_name } @@ -72,20 +79,27 @@ if ($toolsToIgnore -contains $toolName) Write-Success } -$sessionId = $inputData.sessionId -if (-not $sessionId) { +# Session id +if ($inputData.PSObject.Properties['sessionId']) +{ + $sessionId = $inputData.sessionId +} +if (-not $sessionId -and $inputData.PSObject.Properties['session_id']) +{ $sessionId = $inputData.session_id } # Get tool input arguments -$toolInput = $inputData.toolArgs -if (-not $toolInput) +$toolInput = $null +if ($inputData.PSObject.Properties['toolArgs']) +{ + $toolInput = $inputData.toolArgs +} +if (-not $toolInput -and $inputData.PSObject.Properties['tool_input']) { $toolInput = $inputData.tool_input } -$timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") - # Helper to extract path from tool input (handles 'path', 'filePath', 'file_path') function Get-ToolInputPath { @@ -148,7 +162,6 @@ if ($toolName.StartsWith("mcp_azure-sdk") -or $toolName.StartsWith("azure-sdk-mc } # === STEP 3: Publish event === - if ($shouldTrack) { # Build MCP command arguments From 0b3c7508a672904b5e49fef622db4a45e6351295 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 25 Mar 2026 20:53:46 -0400 Subject: [PATCH 2/3] remove azsdk filter for skill name --- eng/common/scripts/azsdk_tool_telemetry.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/azsdk_tool_telemetry.ps1 b/eng/common/scripts/azsdk_tool_telemetry.ps1 index 781a0587b1..748027e16c 100644 --- a/eng/common/scripts/azsdk_tool_telemetry.ps1 +++ b/eng/common/scripts/azsdk_tool_telemetry.ps1 @@ -126,11 +126,12 @@ else $clientType = "copilot-cli" } + # Process skill invocations (looking for "azsdk" prefix in skill name) if ($toolName -eq "skill") { $skillName = $toolInput.skill - if ($skillName -and $skillName.StartsWith("azsdk")) + if ($skillName) { $eventType = "skill_invocation" $shouldTrack = $true From 9c389ee3fb89be068441bc6cc69f92168af297ef Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 25 Mar 2026 21:00:35 -0400 Subject: [PATCH 3/3] Fix typo in comment --- eng/common/scripts/azsdk_tool_telemetry.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/common/scripts/azsdk_tool_telemetry.ps1 b/eng/common/scripts/azsdk_tool_telemetry.ps1 index 748027e16c..04bff02dcc 100644 --- a/eng/common/scripts/azsdk_tool_telemetry.ps1 +++ b/eng/common/scripts/azsdk_tool_telemetry.ps1 @@ -55,9 +55,8 @@ try $toolName = $null $sessionId = $null -$toolInput = $null -# Get tool name. Both vscode and copilot-cli uses different proeprty names, so check for both. +# Get tool name. Both vscode and copilot-cli uses different property names, so check for both. if ($inputData.PSObject.Properties['toolName']) { $toolName = $inputData.toolName