fix: handle both boolean and string types for settings
JSON.parse preserves native types, so boolean true/false stay as booleans rather than strings. The previous check only handled string 'true', meaning users who set `"ENABLED": true` (boolean) wouldn't have the feature work. Now both `getBool()` helper and ResponseProcessor check handle: - String 'true' → enabled - Boolean true → enabled - Any other value → disabled Tested: Confirmed feature stays disabled with string "false" and no new CLAUDE.md files are created when accessing directories.
This commit is contained in:
committed by
Alex Newman
parent
bb96092d74
commit
b07130acc6
@@ -219,7 +219,9 @@ async function syncAndBroadcastObservations(
|
||||
// This runs per-observation batch to ensure folders are updated as work happens
|
||||
// Only runs if CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED is true (default: false)
|
||||
const settings = SettingsDefaultsManager.loadFromFile(USER_SETTINGS_PATH);
|
||||
const folderClaudeMdEnabled = settings.CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED === 'true';
|
||||
// Handle both string 'true' and boolean true from JSON settings
|
||||
const settingValue = settings.CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED;
|
||||
const folderClaudeMdEnabled = settingValue === 'true' || settingValue === true;
|
||||
|
||||
if (folderClaudeMdEnabled) {
|
||||
const allFilePaths: string[] = [];
|
||||
|
||||
@@ -124,10 +124,11 @@ export class SettingsDefaultsManager {
|
||||
|
||||
/**
|
||||
* Get a boolean default value
|
||||
* Handles both string 'true' and boolean true from JSON
|
||||
*/
|
||||
static getBool(key: keyof SettingsDefaults): boolean {
|
||||
const value = this.get(key);
|
||||
return value === 'true';
|
||||
return value === 'true' || value === true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user