mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 21:00:41 +00:00
fix(coding-agent): reload global settings fixes #1241
This commit is contained in:
parent
52638e1c4e
commit
fcfbc82ec2
5 changed files with 83 additions and 0 deletions
|
|
@ -240,6 +240,29 @@ export class SettingsManager {
|
|||
return this.loadProjectSettings();
|
||||
}
|
||||
|
||||
reload(): void {
|
||||
let nextGlobalSettings: Settings | null = null;
|
||||
|
||||
if (this.persist && this.settingsPath) {
|
||||
try {
|
||||
nextGlobalSettings = SettingsManager.loadFromFile(this.settingsPath);
|
||||
this.globalSettingsLoadError = null;
|
||||
} catch (error) {
|
||||
this.globalSettingsLoadError = error as Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextGlobalSettings) {
|
||||
this.globalSettings = nextGlobalSettings;
|
||||
}
|
||||
|
||||
this.modifiedFields.clear();
|
||||
this.modifiedNestedFields.clear();
|
||||
|
||||
const projectSettings = this.loadProjectSettings();
|
||||
this.settings = deepMergeSettings(this.globalSettings, projectSettings);
|
||||
}
|
||||
|
||||
/** Apply additional overrides on top of current settings */
|
||||
applyOverrides(overrides: Partial<Settings>): void {
|
||||
this.settings = deepMergeSettings(this.settings, overrides);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue