roofactor: Migrate Roo provider to AI SDK #11383
Merged
+560
−1,690
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
Migrates the Roo provider from the legacy
BaseOpenAiCompatibleProvider(raw OpenAI SDK streaming) to AI SDK, completing the last production provider migration. Deletes the now-orphaned legacy base class.Changes
src/api/providers/roo.ts— Full rewrite (435→327 lines):BaseProvider+SingleCompletionHandler(wasBaseOpenAiCompatibleProvider)createOpenAICompatible()from@ai-sdk/openai-compatible+streamText/generateTextfromaicreateRooProvider()) with fresh session tokentransformRequestBodycallbackX-Roo-App-Version,X-Roo-Task-ID) via provider configgetApiProtocol) preservedproviderMetadata.roo.costwith client-side fallbackisAiSdkProvider()returnstrue(critical for reasoning parts preservation)generateImage()and dynamic model loading preserved unchangedsrc/api/providers/__tests__/roo.spec.ts— Full test rewrite (45 tests):aiand@ai-sdk/openai-compatibleinstead ofopenaitransformRequestBodysrc/api/providers/base-openai-compatible-provider.ts— Deleted (legacy base class, 0 remaining consumers)src/api/providers/__tests__/base-openai-compatible-provider.spec.ts— Deletedsrc/api/providers/__tests__/base-openai-compatible-provider-timeout.spec.ts— DeletedImportant
Refactors
RooHandlerto use AI SDK, removing legacy base class and updating tests.RooHandlerinroo.tsfromBaseOpenAiCompatibleProviderto AI SDK.createOpenAICompatible()andstreamText/generateTextfor handling requests.createRooProvider()for per-request provider creation with session token.generateImage()functionality.roo.spec.tsto mock AI SDK instead of OpenAI.base-openai-compatible-provider.tsand its tests as they are no longer used.This description was created by
for bcd6298. You can customize this summary. It will automatically update as commits are pushed.