refactor: complete AI SDK migration — all 26 providers + neutral message model + cache unification#11329
Closed
hannesrudolph wants to merge 1 commit intomainfrom
Closed
refactor: complete AI SDK migration — all 26 providers + neutral message model + cache unification#11329hannesrudolph wants to merge 1 commit intomainfrom
hannesrudolph wants to merge 1 commit intomainfrom
Conversation
Contributor
|
Generated with ❤️ by ellipsis.dev |
Contributor
Reviewed 434a0c9 (1 new commit since last review). Both previously flagged issues remain unresolved. No new issues found.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Base automatically changed from
refactor/phase0-remove-low-usage-providers
to
main
February 9, 2026 16:41
bc67511 to
2ee82c1
Compare
0a7cf86 to
59c882e
Compare
… model + cache unification Migrate all 26 providers to AI SDK, replace Anthropic-shaped message types with AI SDK types, eliminate legacy transforms, and unify cache control. Provider Migrations: - 8 providers → OpenAICompatibleHandler (Archetype 1) - 6 providers → dedicated @ai-sdk/* packages (Archetype 2/3) - 3 OpenAI providers → @ai-sdk/openai (Chat Completions + Responses API) - 3 providers → @openrouter/ai-sdk-provider, @ai-sdk/anthropic, @ai-sdk/google-vertex/anthropic - 1 provider → custom LanguageModelV3 adapter (VS Code LM) Type System: - Replace Anthropic.MessageParam with AI SDK types (ToolCallPart, ToolResultPart, ReasoningPart, etc.) - tool_use → tool-call, tool_result → tool-result, thinking → reasoning - id/name/input → toolCallId/toolName/input, tool_use_id → toolCallId - Add migrateApiMessages() for backward-compatible api_conversation_history.json reading - Define RooContentBlock, RooMessageParam, RooMessageMetadata, RedactedReasoningPart Dead Code Removed: - Legacy base classes: BaseOpenAiCompatibleProvider, RouterProvider - Format transforms: r1-format, mistral-format, openai-format, minimax-format, vscode-lm-format - Per-provider caching: caching/anthropic, caching/gemini, caching/vertex, caching/vercel-ai-gateway - anthropic-filter.ts New Dependencies: @ai-sdk/openai, @ai-sdk/anthropic, @ai-sdk/provider New Shared Utility: src/api/transform/caching.ts (unified cache control)
59c882e to
434a0c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete AI SDK migration across the entire provider layer, replacing raw SDK usage, legacy base classes, Anthropic-shaped message types, per-provider format transforms, and per-provider caching logic with a unified AI SDK architecture.
Builds on: PR #11297 (provider removals)
Changes
Provider Migrations (Sessions 1-5)
All 26 remaining providers now use AI SDK:
OpenAICompatibleHandler, ~60-150 lines each@ai-sdk/openai), openai-native, openai-codex, openrouter (@openrouter/ai-sdk-provider), anthropic (@ai-sdk/anthropic), anthropic-vertex (@ai-sdk/google-vertex/anthropic)streamText/generateTextLanguageModelV3adapter wrapping VS Code LM APINeutral Message Model (Session 6)
Replaced
Anthropic.Messages.MessageParamwith provider-agnostic types across 48 production files:NeutralMessageParam,NeutralContentBlock,RooMessageMetadatatypes inapiMessages.tsApiHandler.createMessage()acceptsNeutralMessageParam[](not Anthropic types)@anthropic-ai/sdkisolated to the Anthropic provider itselfTransformer & Cache Cleanup (Session 7)
anthropic-filter.tscaching.tswith sharedapplyCacheBreakpoints()/buildCachedSystemMessage()@anthropic-ai/sdktype importsDead Code Deleted
base-openai-compatible-provider.ts,router-provider.tsr1-format.ts,mistral-format.ts,openai-format.ts,minimax-format.ts,vscode-lm-format.tscaching/anthropic.ts,caching/gemini.ts,caching/vertex.ts,caching/vercel-ai-gateway.tsanthropic-filter.tsNew Dependencies
@ai-sdk/openai(^3.0.26)@ai-sdk/anthropic(^3.0.38)@ai-sdk/provider(^3.0.4)Verification
check-typesKnown Residuals
converters.tsretains@anthropic-ai/sdkimport for tool types (needs neutral tool type definitions)ai-sdk.ts(583 lines) could be further decomposed once storage shifts to AI SDKModelMessageformat@anthropic-ai/sdkfor structurally-compatible fixtures (zero breakage, cosmetic cleanup)