Skip to content

Add copilot-app LLM environment telemetry detection [10.0.4xx]#55443

Open
marcpopMSFT wants to merge 1 commit into
release/10.0.4xxfrom
marcpopmsft-add-copilot-app-telemetry-10.0.4xx
Open

Add copilot-app LLM environment telemetry detection [10.0.4xx]#55443
marcpopMSFT wants to merge 1 commit into
release/10.0.4xxfrom
marcpopmsft-add-copilot-app-telemetry-10.0.4xx

Conversation

@marcpopMSFT

Copy link
Copy Markdown
Member

Backport of #55440 to release/10.0.4xx.

Adds a new copilot-app detection rule to the LLM environment telemetry detector for the GitHub Copilot desktop application, which sets AI_AGENT=github_copilot_app_agent. This is separate from the existing copilot rule (CLI presence via COPILOT_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.

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>
Copilot AI review requested due to automatic review settings July 23, 2026 23:11
@azure-pipelines

Copy link
Copy Markdown
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.

@marcpopMSFT

Copy link
Copy Markdown
Member Author

@baronfel I assume we wanted to backport this so we have 4xx data as well.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 maps AI_AGENT=github_copilot_app_agent to the telemetry llm value "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();
}
}
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.

3 participants