Add copilot-app LLM environment telemetry detection [10.0.4xx]#55443
Open
marcpopMSFT wants to merge 1 commit into
Open
Add copilot-app LLM environment telemetry detection [10.0.4xx]#55443marcpopMSFT wants to merge 1 commit into
marcpopMSFT wants to merge 1 commit into
Conversation
Add a new 'copilot-app' detection rule for the GitHub Copilot desktop application which sets AI_AGENT=github_copilot_app_agent. This is separate from the existing 'copilot' rule (CLI presence). Also fix the LLM environment tests to save/restore ambient environment variables so they pass correctly when the test process runs inside an LLM agent environment (e.g. the Copilot CLI app). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
|
@baronfel I assume we wanted to backport this so we have 4xx data as well. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backports LLM-environment telemetry updates to release/10.0.4xx, adding detection for the GitHub Copilot desktop application and improving test isolation when the test process itself runs under an AI-agent environment.
Changes:
- Add a new
"copilot-app"detection rule that mapsAI_AGENT=github_copilot_app_agentto the telemetryllmvalue"copilot-app". - Update LLM environment tests to save/clear/restore relevant ambient environment variables and add test coverage for
"copilot-app"(including combined detection with Copilot CLI).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Cli/dotnet/Telemetry/LLMEnvironmentDetectorForTelemetry.cs | Adds a new env-var value rule for Copilot desktop app agent detection (copilot-app). |
| test/dotnet.Tests/TelemetryCommonPropertiesTests.cs | Adds/updates LLM detection test cases, including ambient env-var isolation and new copilot-app coverage. |
Comment on lines
188
to
198
| public void TelemetryCommonPropertiesShouldReturnIsLLMDetection() | ||
| { | ||
| var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); | ||
| unitUnderTest.GetTelemetryCommonProperties("dummySessionId")["llm"].Should().BeOneOf("claude", null); | ||
| var llmValue = unitUnderTest.GetTelemetryCommonProperties("dummySessionId")["llm"]; | ||
| // The value may be non-null when tests run inside an LLM agent environment. | ||
| // Just verify the property exists and is either null or a non-empty detection result. | ||
| if (llmValue != null) | ||
| { | ||
| llmValue.Should().NotBeEmpty(); | ||
| } | ||
| } |
baronfel
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #55440 to release/10.0.4xx.
Adds a new
copilot-appdetection rule to the LLM environment telemetry detector for the GitHub Copilot desktop application, which setsAI_AGENT=github_copilot_app_agent. This is separate from the existingcopilotrule (CLI presence viaCOPILOT_CLI).Also fixes the LLM environment tests to save/restore ambient environment variables so they pass correctly when the test process itself runs inside an LLM agent environment.