-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Test a provider-oriented welcome screen #9484
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
Conversation
Latest commit is a formatting fix with no functional changes. Previous issues remain:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| if (data.state === "active-session") { | ||
| try { | ||
| const storedModel = context.globalState.get<string>("roo-provider-model") | ||
| if (storedModel) { | ||
| cloudLogger(`[authStateChangedHandler] Applying stored provider model: ${storedModel}`) | ||
| // Get the current API configuration name | ||
| const currentConfigName = | ||
| provider.contextProxy.getGlobalState("currentApiConfigName") || "default" | ||
| // Update it with the stored model using upsertProviderProfile | ||
| await provider.upsertProviderProfile(currentConfigName, { | ||
| apiProvider: "roo", | ||
| apiModelId: storedModel, | ||
| }) | ||
| // Clear the stored model after applying | ||
| await context.globalState.update("roo-provider-model", undefined) | ||
| cloudLogger(`[authStateChangedHandler] Applied and cleared stored provider model`) | ||
| } |
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.
Race condition: The stored provider model is applied asynchronously during auth state change, but there's no guarantee it completes before the user dismisses the welcome screen or makes other configuration changes. If authentication completes quickly, the model could be applied after the user has already selected a different model, overwriting their choice. Consider using a promise or flag to ensure the model application completes before allowing further configuration changes.
Fix it with Roo Code or mention @roomote and request a fix.
| // Store the provider model if provided | ||
| if (providerModel) { | ||
| await this.context.globalState.update("roo-provider-model", providerModel) | ||
| this.log(`[auth] Stored provider model: ${providerModel}`) | ||
| } |
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.
Missing error cleanup: If authentication fails after storing the provider model but before credential storage completes, the stored model persists in global state. On the next successful login, this orphaned model could be unexpectedly applied. The stored model should be cleaned up in the catch block to prevent this scenario.
Fix it with Roo Code or mention @roomote and request a fix.
|
|
||
| // Store the provider model if provided | ||
| if (providerModel) { | ||
| await this.context.globalState.update("roo-provider-model", providerModel) |
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.
Missing validation: The providerModel parameter is stored without validation. If an invalid model ID is passed (malformed format, non-existent model, or incompatible with the Roo provider), it will be stored and later applied in extension.ts without checks, potentially breaking the API configuration. Consider validating the model ID format and/or existence before storing.
Fix it with Roo Code or mention @roomote and request a fix.
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Working on the following issues:
|
Important
Introduces a provider-oriented welcome screen with support for Roo Code Cloud provider and updates authentication flows and localization.
useProviderSignupparameter tologin()andhandleCallback()inCloudService.tsandWebAuthService.tsto support provider-specific authentication flows.WelcomeViewProvidercomponent inWelcomeViewProvider.tsxfor provider-oriented welcome screen.App.tsxto conditionally renderWelcomeViewProviderbased on feature flag.CloudService.test.tsandWebAuthService.spec.tsto cover new authentication parameters and flows.webview-ui/src/i18n/locales/to include new text for provider selection and descriptions.useProviderSignuptoWebviewMessageinWebviewMessage.tsfor message handling.This description was created by
for c373daa. You can customize this summary. It will automatically update as commits are pushed.