Skip to content

Fix missing reasoningEffort telemetry for Claude models#308325

Open
kevin-m-kent wants to merge 1 commit intomicrosoft:mainfrom
kevin-m-kent:kevin-m-kent/fix-claude-reasoning-effort-telemetry
Open

Fix missing reasoningEffort telemetry for Claude models#308325
kevin-m-kent wants to merge 1 commit intomicrosoft:mainfrom
kevin-m-kent:kevin-m-kent/fix-claude-reasoning-effort-telemetry

Conversation

@kevin-m-kent
Copy link
Copy Markdown
Contributor

Problem

The reasoningEffort telemetry property on response.success and response.error events was only reading from requestBody.reasoning?.effort, which is set by the Responses API path (OpenAI models).

Claude models use the Messages API path, which sets effort via requestBody.output_config?.effort instead. As a result, reasoning effort was silently missing from telemetry for all Claude model requests.

Fix

Added a fallback: requestBody.reasoning?.effort ?? requestBody.output_config?.effort on both response.success and response.error telemetry events so the effort level is captured regardless of which API path is used.

Impact

  • response.success — now logs reasoningEffort for Claude models
  • response.error — now logs reasoningEffort for Claude models
  • No behavior change for OpenAI models (the reasoning.effort path is checked first)

Note: Identical fix also raised for vscode-copilot-chat in microsoft/vscode-copilot-chat#5041

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

Fixes missing reasoningEffort telemetry for Claude (Messages API) requests by falling back to requestBody.output_config?.effort when requestBody.reasoning?.effort is not present, ensuring consistent telemetry across API paths.

Changes:

  • Add requestBody.reasoning?.effort ?? requestBody.output_config?.effort fallback for response.success telemetry.
  • Add the same fallback for response.error telemetry.
Show a summary per file
File Description
extensions/copilot/src/extension/prompt/node/chatMLFetcherTelemetry.ts Ensures reasoningEffort is recorded for both Responses API and Messages API request shapes in success/error telemetry events.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

Copy link
Copy Markdown
Collaborator

@bhavyaus bhavyaus left a comment

Choose a reason for hiding this comment

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

LGTM!

The reasoningEffort telemetry property on response.success and
response.error events was only reading from requestBody.reasoning?.effort
(Responses API / OpenAI), missing Claude models which set effort via
requestBody.output_config?.effort (Messages API). This adds a fallback
to output_config.effort so both events capture the reasoning effort
level regardless of which API path is used.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bhavyaus bhavyaus force-pushed the kevin-m-kent/fix-claude-reasoning-effort-telemetry branch from 8a2d8f9 to 02e33fd Compare April 8, 2026 17:53
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.

4 participants