From 61c94189c68c07c96c60d38af9013c7966475077 Mon Sep 17 00:00:00 2001 From: 0xallam Date: Sat, 10 Jan 2026 15:21:05 -0800 Subject: [PATCH] fix: allow clearing saved config by setting empty env var Co-Authored-By: Claude Opus 4.5 --- strix/config/config.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/strix/config/config.py b/strix/config/config.py index 63c2dc4..0e0d16f 100644 --- a/strix/config/config.py +++ b/strix/config/config.py @@ -109,8 +109,17 @@ class Config: @classmethod def save_current(cls) -> bool: existing = cls.load().get("env", {}) - current = cls.capture_current().get("env", {}) - merged = {**existing, **current} + merged = dict(existing) + + for var_name in cls.tracked_vars(): + value = os.getenv(var_name) + if value is None: + pass + elif value == "": + merged.pop(var_name, None) + else: + merged[var_name] = value + return cls.save({"env": merged})