-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: Attempt to have Dedicated Azure option #9218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Review completed. I've identified 3 issues that need attention:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| options.azureClientSecret | ||
| ) | ||
| // Azure OpenAI/Foundry resource scope | ||
| const scope = options.azureScope || "https://cognitiveservices.azure.com/.default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses options.azureScope but this property isn't defined in the AzureProviderOptions interface. Please add it for type safety.
| .catch(e => { error = e }) | ||
| const start = Date.now() | ||
| while (!token && !error && Date.now() - start < 10000) { | ||
| require("deasync").runLoopOnce() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses require("deasync").runLoopOnce() for synchronous AAD token acquisition, but the deasync package is not declared in package.json dependencies. This will cause a runtime error when users enable AAD authentication (azureUseAAD: true). Add deasync to the dependencies or refactor to use an async initialization pattern.
Fix it with Roo Code or mention @roomote and request a fix.
| options.azureClientSecret | ||
| ) | ||
| // Azure OpenAI/Foundry resource scope | ||
| const scope = options.azureScope || "https://cognitiveservices.azure.com/.default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The azureScope property is referenced here but is not defined in the AzureProviderOptions type (lines 13-28). This will cause TypeScript errors or unexpected runtime behavior if users try to override the scope. The property should be added to the type definition or removed from this line if the default scope is always intended.
Fix it with Roo Code or mention @roomote and request a fix.
| let token: string | undefined | ||
| let error: any | ||
| credential.getToken(scope) | ||
| .then(res => { token = res?.token }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsafe null handling in AAD token acquisition. The promise handler .then(res => { token = res?.token }) doesn't validate that res is defined before accessing .token. If getToken() resolves with undefined (which can happen with certain credential configurations), this will set token to undefined, causing the timeout error on line 77 instead of a more accurate "Invalid token response" error. Consider: .then(res => { if (!res?.token) throw new Error('Invalid token response'); token = res.token }).
Fix it with Roo Code or mention @roomote and request a fix.
Description
This PR implements a comprehensive Azure API Provider for Roo Code, supporting all Azure AI Foundry and Azure OpenAI services, including all current and future GPT-5 variants. The provider features:
Key design choices:
ModelPicker.tsx).Test Procedure
src/api/providers/__tests__/azure.spec.ts.Pre-Submission Checklist
Screenshots / Videos
Documentation Updates
Additional Notes
ModelPicker.tsxfor the dropdown/custom entry implementation.Get in Touch
Discord: iskandarsulaili
Important
Introduces
AzureHandlerfor Azure AI Foundry and OpenAI services with authentication, model registry, error handling, and UI integration.AzureHandlerinazure.tsfor Azure AI Foundry and Azure OpenAI services.ModelPicker.tsxallows model selection via dropdown or manual entry.azure.spec.tsfor endpoints, authentication, model registry, and error handling.@azure/identitytopackage.json.This description was created by
for 7060297. You can customize this summary. It will automatically update as commits are pushed.