Skip to content

codewhale config set accepts typos and unknown keys silently; did-you-mean uses a stale key list #6563

Description

@Hmbown

Found while designing settings-by-conversation. Observed on 0.10.0 in a throwaway home:

  • codewhale config set calm_mode flase and codewhale config set totally_bogus_key 42 both exit 0 and write those values into config.toml. calm_mode lives in settings.toml, so nothing ever reads the write. config doctor still reports clean. The cause is the fallthrough into extras (crates/config/src/lib.rs ~2933).
  • unknown_setting_message suggests keys from the hand-kept Settings::available_settings() (settings.rs ~1933) instead of SETTINGS_SCHEMA.

Fix

  • Validate the key and value type against the declared schema.
  • Refuse unknown keys with the nearest valid key from SETTINGS_SCHEMA.
  • Route settings.toml keys to settings.toml.
  • Make config doctor report keys that nothing reads.
  • Keep an explicit --force escape hatch only if some real workflow needs it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions