-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: persist settings on api.setConfiguration #2341
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
Values weren't being saved to the settings store, preventing switching to newly created profiles.
|
|
|
||
| public async setConfiguration(values: RooCodeSettings) { | ||
| await this.sidebarProvider.setValues(values) | ||
| await this.sidebarProvider.providerSettingsManager.saveConfig(values.currentApiConfigName || "default", values) |
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.
Consider adding error handling around the call to saveConfig. If persisting the configuration fails, it could interrupt subsequent UI updates. Wrapping this call in try/catch (or ensuring errors are caught upstream) will improve robustness.
mrubens
left a comment
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.
Works for me! @cte?
…imation …" (RooCodeInc#2341) This reverts commit 12f16a4.
Context
Values weren't being saved to the settings store, preventing switching to newly created profiles. See this Discord thread for screenshots and source code.
Implementation
See diff. Explicitly call
saveConfigafter changing configurations. I'm not sure that I love taking the name fromcurrentApiConfigNamebut we'd need to rework the API quite a bit to allow for an explicitnameparam.How to Test
Create a custom extension that calls these APIs and do something like this:
Important
In
api.ts,setConfigurationnow persists settings by callingsaveConfigwithcurrentApiConfigNameor "default".api.ts,setConfigurationnow callssaveConfigto persist settings usingcurrentApiConfigNameor "default" if not provided.This description was created by
for 7d2365c. It will automatically update as commits are pushed.