Closed
Description
Local config settings not working properly
Description
After investigating issue #191, I've identified several issues with local (project-level) configuration settings:
- When clearing an individual config value using
mycoder config clear <key>
, the value is not actually removed from the local config file. - Instead, the entire default configuration gets written to the local config file.
- The CLI reports that the value was cleared, but it still shows as coming from the project config.
Steps to reproduce
- Create a project directory with a
.mycoder
subdirectory - Run
mycoder config set headless false
to set a local config value - Verify the config file contains just the headless setting
- Run
mycoder config clear headless
to clear the setting - Check the config file - it now contains all default settings instead of removing the headless setting
Current behavior
When clearing an individual config key:
- The key is not removed from the config file
- The entire default config is merged into the local config file
- The CLI incorrectly reports where the value is coming from
Expected behavior
mycoder config clear <key>
should remove the specified key from the config file- The config file should only contain explicitly set values
- After clearing a key, the value should come from the next level in the hierarchy (global or default)
Possible causes
Looking at the implementation in packages/cli/src/settings/config.ts
, the clearConfigKey
function appears to have an issue. It correctly removes the key from the configuration object, but there may be a problem with how it determines where the new value is coming from after clearing.
Additionally, there seems to be an issue with how the CLI command reports the source of a value after clearing it. In packages/cli/src/commands/config.ts
, the logic for determining where a value comes from after clearing may be incorrect.
Possible solution
- Fix the
clearConfigKey
function to properly remove keys from the config file without merging in default values - Update the reporting logic to correctly identify the source of values after clearing
- Add more tests for the config clearing functionality
Metadata
Metadata
Assignees
Labels
No labels