feat: embed native Harness assistant and verify live task model

This commit is contained in:
阿白叔 committed 2026-10-30 11:32:16 +08:00
1 parent 9c508333bb
commit 96227eed2e
29 files changed
+11110 -582

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
from dx_productivity.dsh.provider_config import load_provider, save_provider
def test_provider_key_is_encrypted_and_models_survive_reload(tmp_path):
key = 'test-credential-not-a-real-key'
save_provider(tmp_path, base_url='https://example.test/v1/', models=['a', 'b'], default_model='b', api_key=key)
assert key not in (tmp_path / 'provider.json').read_text(encoding='utf8')
assert key.encode() not in (tmp_path / 'provider-key.dpapi').read_bytes()
restored = load_provider(tmp_path)
assert restored['DSH_API_KEY'] == key
assert restored['DSH_MODEL'] == 'b'
assert restored['DSH_API_BASE'] == 'https://example.test/v1'