Skip to content

chore: upgrade @anthropic-ai/sdk to 0.104.1 and @anthropic-ai/vertex-sdk to 0.17.1#600

Open
p12tic wants to merge 1 commit into
Zoo-Code-Org:mainfrom
p12tic:anthropic-sdk-upgrade
Open

chore: upgrade @anthropic-ai/sdk to 0.104.1 and @anthropic-ai/vertex-sdk to 0.17.1#600
p12tic wants to merge 1 commit into
Zoo-Code-Org:mainfrom
p12tic:anthropic-sdk-upgrade

Conversation

@p12tic

@p12tic p12tic commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #438

Description

Upgrades Anthropic AI SDK to newer version.

Test Procedure

Check if Anthropic provider still runs fine.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A.

Documentation Updates

Not needed.

Additional Notes

None.

Get in Touch

Mention at github.

Summary by CodeRabbit

  • Bug Fixes

    • Improved image handling across AI provider integrations to correctly process different image source types
    • Enhanced robustness when processing unsupported message content formats with better fallback handling
    • Updated dependencies to latest Anthropic SDK versions
  • New Features

    • Extended markdown export support for additional message content block types

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6cb9213e-b32c-442a-8b2e-fe822709bd47

📥 Commits

Reviewing files that changed from the base of the PR and between 6bcd398 and dec03d6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • src/api/providers/native-ollama.ts
  • src/api/providers/openai-codex.ts
  • src/api/providers/openai-native.ts
  • src/api/transform/mistral-format.ts
  • src/api/transform/openai-format.ts
  • src/api/transform/r1-format.ts
  • src/api/transform/responses-api-input.ts
  • src/api/transform/vscode-lm-format.ts
  • src/api/transform/zai-format.ts
  • src/integrations/misc/export-markdown.ts
  • src/package.json

📝 Walkthrough

Walkthrough

This PR adds defensive type checking for image source handling across message format transformers and API providers, ensuring only base64-sourced images are converted to data URLs; simultaneously extends markdown export to recognize new content block types (tool-reference, document, search-result) and updates Anthropic SDK dependencies.

Changes

Image Source Type Safety

Layer / File(s) Summary
OpenAI format transformer image and tool-result safety
src/api/transform/openai-format.ts
Tool-result content mapping now explicitly handles text parts and returns empty string for non-image/non-text types. Non-tool message parts convert images to data URLs only when source.type === "base64", otherwise emit [Image] placeholder; text parts pass through as-is.
Format transformers image source validation
src/api/transform/mistral-format.ts, src/api/transform/r1-format.ts, src/api/transform/responses-api-input.ts, src/api/transform/vscode-lm-format.ts, src/api/transform/zai-format.ts
Mistral, R1, Responses API, VS Code LM, and ZAI transformers each guard base64 data URL construction with part.source.type === "base64" checks. Non-base64 images are skipped or replaced with placeholders; VS Code LM conditionally updates placeholder text based on source type.
Provider image and text content type safety
src/api/providers/native-ollama.ts, src/api/providers/openai-codex.ts, src/api/providers/openai-native.ts
Native Ollama adds explicit part.type === "text" check in tool-result mapping; OpenAI Codex and OpenAI Native guard image block conversion with source.type === "base64" checks, preventing unconditional data URL construction from non-base64 sources.

Extended Content Block Type Support

Layer / File(s) Summary
Markdown export content block type expansion
src/integrations/misc/export-markdown.ts
ExtendedContentBlock type union adds ToolReferenceBlockParam alongside existing Anthropic and custom block types. formatContentBlockToMarkdown gains switch cases for document, search_result, and tool_reference, each returning a fixed placeholder label.

Anthropic SDK Version Update

Layer / File(s) Summary
Anthropic SDK dependency versions
src/package.json
@anthropic-ai/sdk and @anthropic-ai/vertex-sdk version ranges bumped from ^0.37.0 and ^0.7.0 to ^0.104.1 and ^0.17.1, respectively.

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 Base64 checks bloom like clover,
No more forcing non-base64 over,
Image sources now play it safe,
With placeholders keeping proper pace,
The SDK leaps, content blocks embrace! 🌱

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #438 reports HTTP proxy being ignored in Anthropic provider; the code changes only address SDK version compatibility and image/content-type handling, not proxy functionality. The PR does not address the core issue (#438): HTTP proxy support for the Anthropic provider. Verify whether the SDK upgrade itself fixes proxy handling, or implement explicit proxy configuration changes.
Out of Scope Changes check ⚠️ Warning The PR includes changes beyond dependency upgrades: image source-type validation in multiple format transformers and export-markdown.ts content block expansion, which are beyond a simple SDK version bump. Either justify why these format/transformation changes are necessary for the SDK upgrade, or move them to a separate PR to maintain clear scope separation from the dependency upgrade.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: upgrading Anthropic SDK packages to specific versions as confirmed by the package.json changes.
Description check ✅ Passed The PR description provides the required sections (issue link, description, test procedure, checklist) and follows the template structure, though testing details are minimal.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

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.

[BUG] HTTP proxy is ignored on Anthropic provider

1 participant