From cb3a1662d9c370c3ffe25ac80fda9d0ffc82a10a Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sat, 6 Jun 2026 21:36:37 +0545 Subject: [PATCH] refactor(devgen/cli): reorder config merge to preserve key order Preserves insertion order and prevents accidental overwriting of existing keys --- devgen/cli/setup.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/devgen/cli/setup.py b/devgen/cli/setup.py index f57c773..fb996c8 100644 --- a/devgen/cli/setup.py +++ b/devgen/cli/setup.py @@ -86,13 +86,16 @@ def setup_config() -> None: ollama_host = ollama_host_input.strip() or ollama_host # Save Config — merge with existing to preserve extra keys - new_config = {**current_config, **{ - "provider": provider, - "model": model, - "api_key": api_key, - "emoji": emoji, - "ollama_host": ollama_host, - }} + new_config = { + **current_config, + **{ + "provider": provider, + "model": model, + "api_key": api_key, + "emoji": emoji, + "ollama_host": ollama_host, + }, + } try: with config_path.open("w", encoding="utf-8") as f: