Skip to content

Commit 83576b4

Browse files
authored
Merge branch 'main' into mohessie/unify_output/tool_call_accuracy
2 parents aa848fe + 5f7e04e commit 83576b4

3 files changed

Lines changed: 78 additions & 3 deletions

File tree

.github/workflows/event-processor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: 'Az CLI login'
35-
uses: azure/login@v2
35+
uses: azure/login@v3
3636
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
3737
with:
3838
client-id: a6dd2dfe-7352-41a7-9020-05301c3bca1a

eng/common/pipelines/templates/steps/verify-agent-os.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@ steps:
1414
filePath: ${{ parameters.ScriptDirectory }}/Verify-AgentOS.ps1
1515
arguments: >
1616
-AgentImage "${{ parameters.AgentImage }}"
17-
18-
- template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
$ErrorActionPreference = "SilentlyContinue"
2+
. (Join-Path $PSScriptRoot '..' 'scripts' 'Helpers' 'AzSdkTool-Helpers.ps1')
3+
4+
$cliPath = Get-CommonInstallDirectory
5+
$cliPath = Join-Path $cliPath "azsdk"
6+
7+
# Skip telemetry if opted out
8+
if ($env:AZSDKTOOLS_COLLECT_TELEMETRY -eq "false")
9+
{
10+
Write-Success
11+
}
12+
13+
# Return success and exit
14+
function Write-Success
15+
{
16+
Write-Output '{"continue":true}'
17+
exit 0
18+
}
19+
20+
# Read entire stdin at once - hooks send one complete JSON per invocation
21+
try
22+
{
23+
$rawInput = [Console]::In.ReadToEnd()
24+
} catch
25+
{
26+
Write-Success
27+
}
28+
# Return success and exit if no input
29+
if ([string]::IsNullOrWhiteSpace($rawInput))
30+
{
31+
Write-Success
32+
}
33+
34+
try
35+
{
36+
$inputData = $rawInput | ConvertFrom-Json
37+
} catch {
38+
Write-Success
39+
}
40+
$prompt = $inputData.prompt
41+
$sessionId = $null
42+
$eventType = "user_prompt"
43+
$clientType = $null
44+
45+
# Session id
46+
if ($inputData.PSObject.Properties['sessionId'])
47+
{
48+
$sessionId = $inputData.sessionId
49+
$clientType = "copilot-cli"
50+
}
51+
if (-not $sessionId -and $inputData.PSObject.Properties['session_id'])
52+
{
53+
$sessionId = $inputData.session_id
54+
$clientType = "vscode"
55+
}
56+
57+
# === STEP 2: Publish event ===
58+
# Build MCP command arguments
59+
$cliArgs = @(
60+
"ingest-telemetry",
61+
"--client-type", $clientType,
62+
"--event-type", $eventType,
63+
"--session-id", $sessionId,
64+
"--body", "'$prompt'"
65+
)
66+
67+
# run azsdk cli to ingest telemetry (non-blocking)
68+
try
69+
{
70+
Start-Process -FilePath $cliPath -ArgumentList $cliArgs -NoNewWindow
71+
}
72+
catch
73+
{
74+
Write-Success
75+
}
76+
# Output success to stdout (required by hooks)
77+
Write-Success

0 commit comments

Comments
 (0)