lean-ctx icon indicating copy to clipboard operation
lean-ctx copied to clipboard

bug: `lean-ctx config set` doesn't seem to work

Open teadatuntud opened this issue 6 months ago • 1 comments

lean-ctx version: (run lean-ctx --version) lean-ctx 3.6.22 (official, https://github.com/yvgude/lean-ctx)

OS: (macOS / Linux / Windows) Linux

AI tool: (Cursor / Claude Code / Copilot / Crush / other) N/A -- this is run in the terminal directly

What happened: I want to change the config values on the terminal via lean-ctx config set.

What you expected: The value to be changed.

Steps to reproduce:

  1. Run lean-ctx config set proxy_enabled false, but this doesn't seem to be limited to this config attribute specifically.

Relevant output:

Unknown config key: proxy_enabled

teadatuntud avatar May 28 '26 14:05 teadatuntud

Fixed in v3.6.23 (released).

Root cause: lean-ctx config set used a hardcoded match arm with only ~12 keys, while the config schema defines 80+ valid keys.

Fix: Implemented a generic schema-based setter (config/setter.rs) that:

  1. Validates any key against the ConfigSchema
  2. Parses values according to the schema type (bool, integer, float, string, enum, string[])
  3. Performs a TOML round-trip with full serde validation
  4. Shows allowed enum values on invalid input

All documented config keys now work with lean-ctx config set, including proxy_enabled, profile, compression_level, memory_profile, etc.

Example:

$ lean-ctx config set proxy_enabled false
Updated proxy_enabled = false

$ lean-ctx config set compression_level invalid
Invalid value 'invalid'. Allowed: off, lite, standard, max

Available via lean-ctx update once v3.6.23 propagates.

yvgude avatar May 28 '26 15:05 yvgude