Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Fix missing reasoningEffort telemetry for Claude models#5041

Closed
kevin-m-kent wants to merge 1 commit into
microsoft:mainfrom
kevin-m-kent:kevin-m-kent/fix-claude-reasoning-effort-telemetry
Closed

Fix missing reasoningEffort telemetry for Claude models#5041
kevin-m-kent wants to merge 1 commit into
microsoft: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)

The reasoningEffort telemetry property 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 response.success and response.error events capture the
reasoning effort level regardless of which API path is used.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 7, 2026 18:15
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

Adds missing telemetry capture for reasoning effort when using Claude/Anthropic models via the Messages API, aligning telemetry across OpenAI Responses API and Anthropic Messages API request shapes.

Changes:

  • Update response.success telemetry to fall back to requestBody.output_config?.effort when requestBody.reasoning?.effort is absent.
  • Update response.error telemetry with the same fallback so failures also record reasoning effort.
Show a summary per file
File Description
src/extension/prompt/node/chatMLFetcherTelemetry.ts Adds output_config.effort fallback so reasoningEffort telemetry is recorded for Claude/Messages API requests.

Copilot's findings

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

@kevin-m-kent
Copy link
Copy Markdown
Contributor Author

Closing in favor of the vscode repo version: microsoft/vscode#308325

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants