Skip to content

Fix missing reasoningEffort telemetry for Claude models#309639

Merged
bhavyaus merged 1 commit intomainfrom
fix/claude-reasoning-effort-telemetry
Apr 13, 2026
Merged

Fix missing reasoningEffort telemetry for Claude models#309639
bhavyaus merged 1 commit intomainfrom
fix/claude-reasoning-effort-telemetry

Conversation

@bhavyaus
Copy link
Copy Markdown
Collaborator

Cherry-pick of #308325.

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)

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>
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 reading effort from the correct request-body field, while preserving existing behavior for OpenAI (Responses API) requests.

Changes:

  • Update response.success telemetry to read reasoningEffort from requestBody.reasoning?.effort ?? requestBody.output_config?.effort.
  • Update response.error telemetry to read reasoningEffort from requestBody.reasoning?.effort ?? requestBody.output_config?.effort.
Show a summary per file
File Description
extensions/copilot/src/extension/prompt/node/chatMLFetcherTelemetry.ts Adds a fallback to capture reasoning effort from the Messages API payload shape (output_config.effort) for both success and error telemetry.

Copilot's findings

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

@bhavyaus bhavyaus added the ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch label Apr 13, 2026
@bhavyaus bhavyaus added this to the 1.116.0 milestone Apr 13, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

This PR will be automatically cherry-picked to release/1.116 when merged.

@bhavyaus bhavyaus merged commit 083e1db into main Apr 13, 2026
30 checks passed
@bhavyaus bhavyaus deleted the fix/claude-reasoning-effort-telemetry branch April 13, 2026 22:12
@vs-code-engineering vs-code-engineering bot added the release-cherry-pick Automated cherry-pick between release and main branches label Apr 13, 2026
@vs-code-engineering vs-code-engineering bot removed the ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-cherry-pick Automated cherry-pick between release and main branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants