Skip to content

Conversation

@bhavyaus
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 29, 2026 21:30
@bhavyaus bhavyaus enabled auto-merge January 29, 2026 21:30
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 29, 2026
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 telemetry tracking for the tool search feature in the Anthropic Messages API integration. The telemetry captures both successful tool discoveries and error cases, providing insights into tool search usage and performance.

Changes:

  • Injected ITelemetryService into AnthropicMessagesProcessor constructor for telemetry collection
  • Added telemetry event on successful tool discovery that tracks the number of tools found and related metadata
  • Added telemetry event on tool search errors that captures error codes and context
Comments suppressed due to low confidence (1)

src/platform/endpoint/node/messagesApi.ts:556

  • The interactionId is set to the same value as requestId. In the codebase, interactionId is typically used to group multiple requests into a logical user interaction (see IInteractionService in src/platform/chat/common/interactionService.ts), while requestId identifies a single request. Using the same value for both reduces the ability to correlate multiple tool search invocations that occur within the same user interaction. Consider passing the interaction ID from the calling context if available, or document that this is intentional due to architectural constraints.
							{ requestId: this.requestId, interactionId: this.requestId, validateOutcome: 'unknown', invokeOutcome: 'error', toolName: TOOL_SEARCH_TOOL_NAME, model: this.model, errorCode: toolSearchResult.content.error_code },

}
*/
this.telemetryService.sendMSFTTelemetryEvent('toolSearchToolInvoked',
{ requestId: this.requestId, interactionId: this.requestId, validateOutcome: 'unknown', invokeOutcome: 'success', toolName: TOOL_SEARCH_TOOL_NAME, model: this.model },
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The interactionId is set to the same value as requestId. In the codebase, interactionId is typically used to group multiple requests into a logical user interaction (see IInteractionService in src/platform/chat/common/interactionService.ts), while requestId identifies a single request. Using the same value for both reduces the ability to correlate multiple tool search invocations that occur within the same user interaction. Consider passing the interaction ID from the calling context if available, or document that this is intentional due to architectural constraints.

Suggested change
{ requestId: this.requestId, interactionId: this.requestId, validateOutcome: 'unknown', invokeOutcome: 'success', toolName: TOOL_SEARCH_TOOL_NAME, model: this.model },
{ requestId: this.requestId, validateOutcome: 'unknown', invokeOutcome: 'success', toolName: TOOL_SEARCH_TOOL_NAME, model: this.model },

Copilot uses AI. Check for mistakes.
@bhavyaus bhavyaus added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit 0673045 Jan 29, 2026
25 checks passed
@bhavyaus bhavyaus deleted the dev/bhavyau/update-telemetry branch January 29, 2026 22:02
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