Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 1, 2026

This PR migrates the Azure OpenAI provider to use the AI SDK's dedicated @ai-sdk/azure package, following the exact pattern established in recent provider migrations (DeepSeek, Groq, Fireworks).

Changes

New Azure Provider (src/api/providers/azure.ts)

  • Implements AzureHandler extending BaseProvider
  • Uses createAzure from @ai-sdk/azure for native Azure OpenAI support
  • Supports streamText and generateText from AI SDK
  • Handles tool calls via tool-input-start/delta/end events
  • Extracts usage metrics including cache metrics from providerMetadata

Provider Type Registration

  • Added "azure" to providerNames in packages/types/src/provider-settings.ts
  • Created azureSchema with Azure-specific options:
    • azureApiKey - Azure OpenAI API key
    • azureResourceName - Azure resource name
    • azureDeploymentName - Azure deployment name
    • azureApiVersion - API version (defaults to azureOpenAiDefaultApiVersion)
  • Added Azure to providerSettingsSchemaDiscriminated and providerSettingsSchema
  • Added modelIdKeysByProvider entry for azure
  • Added Azure to MODELS_BY_PROVIDER

Build System

  • Added @ai-sdk/azure dependency to src/package.json
  • Added AzureHandler export to src/api/providers/index.ts
  • Added "azure" case to buildApiHandler in src/api/index.ts

UI Integration

  • Added Azure case to useSelectedModel.ts switch statement

Tests (src/api/providers/__tests__/azure.spec.ts)

  • Constructor tests
  • getModel tests
  • Streaming response tests
  • Usage metrics tests with cache metrics from providerMetadata
  • Tool call handling via tool-input-start/delta/end events
  • Error handling tests
  • completePrompt tests

View task on Roo Code Cloud


Important

Introduces Azure OpenAI provider using @ai-sdk/azure, updating provider settings, UI integration, and adding tests.

  • Azure Provider Implementation:
    • Adds AzureHandler in azure.ts extending BaseProvider for Azure OpenAI support using @ai-sdk/azure.
    • Supports streamText and generateText methods.
    • Handles tool calls and extracts usage metrics.
  • Provider Settings:
    • Registers "azure" in providerNames and adds azureSchema in provider-settings.ts.
    • Updates providerSettingsSchemaDiscriminated and providerSettingsSchema for Azure.
    • Adds Azure validation in validate.ts.
  • UI and Tests:
    • Integrates Azure provider in useSelectedModel.ts and ApiOptions.tsx.
    • Adds Azure-specific tests in azure.spec.ts.

This description was created by Ellipsis for 1c3437f. You can customize this summary. It will automatically update as commits are pushed.

@roomote
Copy link
Contributor Author

roomote bot commented Feb 1, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. The Azure OpenAI provider implementation correctly follows the established AI SDK migration pattern and includes comprehensive test coverage, proper UI integration, and complete validation.

  • No bugs or issues identified
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@daniel-lxs daniel-lxs marked this pull request as ready for review February 2, 2026 02:36
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners February 2, 2026 02:36
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. Enhancement New feature or request labels Feb 2, 2026
@roomote
Copy link
Contributor Author

roomote bot commented Feb 2, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The Azure OpenAI provider implementation correctly follows the established AI SDK migration pattern (DeepSeek, Groq, Fireworks). The handler properly integrates with @ai-sdk/azure, includes comprehensive test coverage, and has complete UI integration with translations for all locales.

  • No bugs or issues identified

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 2, 2026
@daniel-lxs daniel-lxs marked this pull request as draft February 2, 2026 17:29
roomote and others added 6 commits February 3, 2026 15:36
- Add azureApiKey to SECRET_STATE_KEYS for proper configuration detection
- Add Azure validation case in validateModelsAndKeysProvided
- Add validation translations for azureResourceName and azureDeploymentName across all 18 locales

This fixes the issue where the Finish button does nothing when setting up Azure provider in the onboarding workflow.
@hannesrudolph hannesrudolph force-pushed the feature/azure-ai-sdk-migration branch from 25d2476 to 1c3437f Compare February 3, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants