Skip to content

add support for detecting OpenAI Codex usage of the dotnet CLI#52861

Closed
baronfel wants to merge 4 commits intodotnet:release/10.0.3xxfrom
baronfel:add-codex-detection-support
Closed

add support for detecting OpenAI Codex usage of the dotnet CLI#52861
baronfel wants to merge 4 commits intodotnet:release/10.0.3xxfrom
baronfel:add-codex-detection-support

Conversation

@baronfel
Copy link
Member

@baronfel baronfel commented Feb 5, 2026

Quick PR to add one more heuristic.

Copy link
Contributor

Copilot AI left a comment

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 adds support for detecting OpenAI Codex usage of the dotnet CLI through telemetry. However, it also includes undocumented changes to the detection rules for Claude Code and Cursor AI environments.

Changes:

  • Adds new telemetry detection for OpenAI Codex via the CODEX_THREAD_ID environment variable
  • Changes CLAUDECODE and CURSOR_EDITOR detection from AnyPresentEnvironmentRule to BooleanEnvironmentRule
  • Adds test case for CODEX_THREAD_ID detection

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/Cli/dotnet/Telemetry/LLMEnvironmentDetectorForTelemetry.cs Adds Codex detection rule and changes Claude/Cursor rules from AnyPresentEnvironmentRule to BooleanEnvironmentRule
test/dotnet.Tests/TelemetryCommonPropertiesTests.cs Adds test case for CODEX_THREAD_ID environment variable

@baronfel baronfel enabled auto-merge (squash) February 5, 2026 20:19
@baronfel
Copy link
Member Author

baronfel commented Feb 6, 2026

@copilot make the rules I added/changed all use the 'accept any' strategy - I am dumb and forgot that the values might not be booleans which is causing the test failures.

@baronfel
Copy link
Member Author

baronfel commented Feb 6, 2026

/azp run dotnet-sdk-public-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@baronfel
Copy link
Member Author

baronfel commented Feb 6, 2026

Going to close this in favor of #52878 which is more comprehensive.

@baronfel baronfel closed this Feb 6, 2026
auto-merge was automatically disabled February 6, 2026 18:59

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants