-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix model selection after anonymous usage #5503
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2259,11 +2259,13 @@ export const webviewMessageHandler = async ( | |||||||||
| if (message.text && message.apiConfiguration) { | ||||||||||
| let configToSave = message.apiConfiguration | ||||||||||
| let organizationChanged = false | ||||||||||
| let currentConfig: any = undefined | ||||||||||
|
|
||||||||||
| try { | ||||||||||
| const { ...currentConfig } = await provider.providerSettingsManager.getProfile({ | ||||||||||
| currentConfig = await provider.providerSettingsManager.getProfile({ | ||||||||||
| name: message.text, | ||||||||||
| }) | ||||||||||
|
|
||||||||||
| // Only clear organization ID if we actually had a kilocode token before and it's different now | ||||||||||
| const hadPreviousToken = currentConfig.kilocodeToken !== undefined | ||||||||||
| const hasNewToken = message.apiConfiguration.kilocodeToken !== undefined | ||||||||||
|
|
@@ -2301,11 +2303,12 @@ export const webviewMessageHandler = async ( | |||||||||
| }) | ||||||||||
| } | ||||||||||
| } catch (error) { | ||||||||||
| // Config might not exist yet, that's fine | ||||||||||
| // Profile doesn't exist yet (expected for new profiles) | ||||||||||
| // This is fine - we'll create it below | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // kilocode_change start: If we're updating the active profile, we need to activate it to ensure it's persisted | ||||||||||
| const currentApiConfigName = getGlobalState("currentApiConfigName") | ||||||||||
| const currentApiConfigName = getGlobalState("currentApiConfigName") || "default" | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SUGGESTION: Prefer nullish coalescing to avoid treating falsy-but-valid values as "default" Using
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SUGGESTION: Prefer nullish coalescing ( Using
Suggested change
|
||||||||||
| const isActiveProfile = message.text === currentApiConfigName | ||||||||||
| await provider.upsertProviderProfile(message.text, configToSave, isActiveProfile) // Activate if it's the current active profile | ||||||||||
| vscode.commands.executeCommand("kilo-code.ghost.reload") | ||||||||||
|
|
||||||||||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.