Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Anthropic SDK 12.2.0 renamed ClientOptions.APIKey to ClientOptions.ApiKey.

Changes

  • Directory.Packages.props: Bump Anthropic from 12.1.0 to 12.2.0
  • samples/QuickstartClient/Program.cs: Update property name from APIKey to ApiKey
-using var anthropicClient = new AnthropicClient(new() { APIKey = builder.Configuration["ANTHROPIC_API_KEY"] })
+using var anthropicClient = new AnthropicClient(new() { ApiKey = builder.Configuration["ANTHROPIC_API_KEY"] })

This is the only breaking change affecting the codebase.

Original prompt

Summary

This PR updates the Anthropic SDK dependency from version 12.1.0 to 12.2.0 and fixes any breaking changes introduced by the update.

Background

Dependabot opened PR #1161 to bump the Anthropic SDK, but the PR's mergeable state is "blocked", potentially due to CI failures from breaking changes in the new SDK version.

Changes in Anthropic SDK 12.2.0 (from 12.1.0)

Based on the Anthropic SDK 12.2.0 release notes:

Features

  • Add helper functions for raw messages
  • Add more ToString implementations
  • Add strong naming
  • Support WithRawResponse in Foundry client
  • Support accessing raw responses

Bug Fixes (Potentially Breaking)

  • use Properties initializer for InputSchema in IChatClient extensions (PR Implement the new "Streamable HTTP" transport #83) - This fix changes how InputSchema properties are initialized and may affect code using IChatClient extensions
  • Add missing serializer options
  • Copy path params in params copy constructors
  • Ensure deep immutability for deep array/dict structures
  • Freeze models on property access
  • Throw api enum errors as invalid data exception
  • Union switch method type checks
  • Use readonly type for param

Chores

  • Mark claude-3-5-haiku as deprecated

Task

  1. Update Directory.Packages.props to change the Anthropic package version from 12.1.0 to 12.2.0 (line 63)
  2. Review and fix any code in the repository that uses the Anthropic SDK, particularly:
    • samples/QuickstartClient/Program.cs - Uses AnthropicClient and AsIChatClient extension
    • Any test files that mock or use Anthropic SDK types
  3. Ensure all tests pass after the update
  4. If the InputSchema property initialization has changed, update any code that sets or accesses this property

Files to Review

  • Directory.Packages.props - Package version definition
  • samples/QuickstartClient/Program.cs - Main usage of Anthropic SDK
  • Any test files in tests/ that reference Anthropic types

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Anthropic SDK dependency to version 12.2.0 Update Anthropic SDK to 12.2.0 Jan 19, 2026
Copilot AI requested a review from eiriktsarpalis January 19, 2026 14:21
@eiriktsarpalis eiriktsarpalis marked this pull request as ready for review January 19, 2026 14:53
@eiriktsarpalis eiriktsarpalis merged commit eca882e into main Jan 19, 2026
7 of 10 checks passed
@eiriktsarpalis eiriktsarpalis deleted the copilot/update-anthropic-sdk-12-2-0 branch January 19, 2026 16:00
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.

2 participants