refactor(config): unify secrets in ~/.mytoolkit/config.json and migrate skill wrappers

This commit is contained in:
Zhengshou Lai
2026-07-19 09:49:01 +08:00
parent 7ff58f4695
commit b7749a9b06
17 changed files with 1517 additions and 92 deletions
+1
View File
@@ -9,3 +9,4 @@ import os
import tempfile
os.environ["MYTOOLKIT_HOME"] = tempfile.mkdtemp(prefix="mytoolkit-test-home-")
os.environ["MYTOOLKIT_NO_EXTERNAL_MIGRATION"] = "1"
+2 -2
View File
@@ -77,6 +77,6 @@ def test_legacy_env_merges_without_clobbering_existing_keys(fresh_home):
json.dumps({"vars": {"apikey_ark": "sk-old", "extra": "e"}})
)
c = Config()
# Legacy vars are merged in (documented behaviour: legacy wins on conflict).
# Unknown legacy vars are merged in; known keys keep the existing mytoolkit value.
assert c.get("extra") == "e"
assert c.get("apikey_ark") == "sk-old"
assert c.get("apikey_ark") == "sk-new"