-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 all commits
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "kilo-code": patch | ||
| --- | ||
|
|
||
| Fix mode selection after anonymous usage |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2305,7 +2305,7 @@ export const webviewMessageHandler = async ( | |||||
| } | ||||||
|
|
||||||
| // 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 ( 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") | ||||||
|
|
||||||
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.
SUGGESTION: Prefer nullish coalescing to avoid treating falsy-but-valid values as "default"
Using
||will replace any falsy value (e.g. an empty string) with"default". IfcurrentApiConfigNameis only everstring | undefined, using??is a safer defaulting pattern.