-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(anthropic): enable native tools by default and add telemetry tracking #10021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Review complete. No issues found. This PR cleanly enables native tools by default for Anthropic models and adds telemetry tracking, following the same patterns established in the OpenRouter provider. The additional changes for auto-approval pause functionality and tool result validation are well-implemented and tested. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
…cking - Add defaultToolProtocol: 'native' to all Anthropic model definitions - Use resolveToolProtocol() to properly resolve tool protocol based on model defaults - Add telemetry tracking to createMessage and completePrompt errors using ApiProviderError - Update tests to reflect native tools being enabled by default This matches OpenRouter's approach of enabling native tools by default.
f5520f1 to
491d4dd
Compare
Following the pattern established in PR #10021 for Anthropic, enable native tools by default across multiple providers by adding `defaultToolProtocol: "native"` to model definitions. Providers updated: - Gemini (10 models) - Vertex (18 models) - OpenAI Native (32 models) - xAI (8 models) - Mistral (9 models) - Cerebras (5 models) - Bedrock Claude (16 models) - Groq (7 models) - Fireworks (13 models) - SambaNova (8 models) - Doubao (3 models) Total: ~129 models now default to native tool protocol. Also updated tests to reflect native as default: - openai-native.spec.ts - xai.spec.ts - mistral.spec.ts
Following the pattern established in PR #10021 for Anthropic, enable native tools by default across multiple providers by adding `defaultToolProtocol: "native"` to model definitions. Providers updated: - Gemini (10 models) - Vertex (18 models) - OpenAI Native (32 models) - xAI (8 models) - Mistral (9 models) - Cerebras (5 models) - Bedrock Claude (16 models) - Groq (7 models) - Fireworks (13 models) - SambaNova (8 models) - Doubao (3 models) Total: ~129 models now default to native tool protocol. Also updated tests to reflect native as default: - openai-native.spec.ts - xai.spec.ts - mistral.spec.ts
Summary
Enable native tools by default for Anthropic provider and add telemetry tracking to errors, matching OpenRouter's approach.
Changes
1.
packages/types/src/providers/anthropic.tsAdded
defaultToolProtocol: "native"to all 13 Anthropic model definitions to enable native tools by default through theresolveToolProtocol()utility.2.
src/api/providers/anthropic.tsTOOL_PROTOCOLandresolveToolProtocolshouldIncludeNativeToolslogic to useresolveToolProtocol(this.options, model.info)which respects the model'sdefaultToolProtocolTelemetryService.instance.captureException()withApiProviderErrorfor all API calls (createMessageandcompletePrompt)3.
src/api/providers/__tests__/anthropic.spec.tstoolProtocol: "native"from handler options since native is now the default4.
src/core/task/__tests__/Task.spec.tsgetMcpHubmock to provider in Subtask Rate Limiting tests to support native tools code pathHow It Works
defaultToolProtocol: "native"in model definitionstoolProtocol: "xml"in their profile settingsTesting
Important
Enable native tools by default for Anthropic models and add error telemetry tracking.
defaultToolProtocol: "native"inanthropic.ts.TelemetryService.instance.captureException()inanthropic.ts.anthropic.spec.tsto reflect native tools as default, removing explicittoolProtocol: "native".getMcpHubinTask.spec.tsto support native tools code path.TOOL_PROTOCOLandresolveToolProtocolinanthropic.tsto manage tool protocol logic.This description was created by
for f5520f1. You can customize this summary. It will automatically update as commits are pushed.